huaweicloud-devkit 1.1.14-next.2 → 2.0.0-next.1

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 (706) hide show
  1. package/README.md +16 -17
  2. package/README.zh-CN.md +16 -17
  3. package/bin/dsh-postinstall.cjs +171 -31
  4. package/bin/setup.cjs +1 -1
  5. package/cordis.patch.yml +1 -1
  6. package/integrations/atomcode/hooks/huaweicloud-telemetry.js +29 -33
  7. package/integrations/dsh/hook-plugin.d.mts +19 -0
  8. package/integrations/dsh/hook-plugin.mjs +23 -22
  9. package/integrations/hermes/hooks/huaweicloud-telemetry.py +26 -43
  10. package/integrations/hermes/manifest.yaml +35 -10
  11. package/integrations/opencode/commands/huaweicloud-doctor.md +3 -2
  12. package/integrations/opencode/hooks/skill-tracker.js +70 -89
  13. package/integrations/opencode/opencode.json +5 -6
  14. package/integrations/workbuddy/hooks/telemetry-tracker.py +27 -45
  15. package/package.json +32 -11
  16. package/plugins/huaweicloud-core/.claude-plugin/plugin.json +1 -2
  17. package/plugins/huaweicloud-core/.codex-plugin/plugin.json +1 -2
  18. package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +1 -2
  19. package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +1 -2
  20. package/plugins/huaweicloud-core/.mcp.json +1 -1
  21. package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +1 -2
  22. package/plugins/huaweicloud-core/dist/agents/atomcode.js +118 -0
  23. package/plugins/huaweicloud-core/dist/agents/codearts-work.js +121 -0
  24. package/plugins/huaweicloud-core/dist/agents/codearts.js +69 -0
  25. package/plugins/huaweicloud-core/dist/agents/codex-desktop.js +193 -0
  26. package/plugins/huaweicloud-core/dist/agents/codex.js +205 -0
  27. package/plugins/huaweicloud-core/dist/agents/dsh-patch.js +172 -0
  28. package/plugins/huaweicloud-core/dist/agents/dsh.js +129 -0
  29. package/plugins/huaweicloud-core/dist/agents/hermes-config.js +976 -0
  30. package/plugins/huaweicloud-core/dist/agents/hermes-hook-plugin.js +90 -0
  31. package/plugins/huaweicloud-core/dist/agents/hermes-hooks.js +166 -0
  32. package/plugins/huaweicloud-core/dist/agents/hermes-sdk.js +58 -0
  33. package/plugins/huaweicloud-core/dist/agents/hermes.js +150 -0
  34. package/plugins/huaweicloud-core/dist/agents/officeace-registry.js +179 -0
  35. package/plugins/huaweicloud-core/dist/agents/officeace-sqlite.js +142 -0
  36. package/plugins/huaweicloud-core/dist/agents/officeace.js +173 -0
  37. package/plugins/huaweicloud-core/dist/agents/openclaw.js +54 -0
  38. package/plugins/huaweicloud-core/dist/agents/opencode-config.js +192 -0
  39. package/plugins/huaweicloud-core/dist/agents/opencode.js +112 -0
  40. package/plugins/huaweicloud-core/dist/agents/workbuddy.js +194 -0
  41. package/plugins/huaweicloud-core/dist/approvals-cli.js +159 -0
  42. package/plugins/huaweicloud-core/dist/auth/account-type.js +136 -0
  43. package/plugins/huaweicloud-core/dist/auth/agent-registration.js +243 -0
  44. package/plugins/huaweicloud-core/dist/auth/cli.js +114 -0
  45. package/plugins/huaweicloud-core/dist/auth/codearts-context.js +131 -0
  46. package/plugins/huaweicloud-core/dist/auth/credential-placeholder.js +41 -0
  47. package/plugins/huaweicloud-core/dist/auth/credential-resolver.js +74 -0
  48. package/plugins/huaweicloud-core/dist/auth/credential-validator.js +139 -0
  49. package/plugins/huaweicloud-core/dist/auth/credentials.js +20 -0
  50. package/plugins/huaweicloud-core/dist/auth/error-table.js +123 -0
  51. package/plugins/huaweicloud-core/dist/auth/hcloud-profile.js +89 -0
  52. package/plugins/huaweicloud-core/dist/auth/init-cli.js +139 -0
  53. package/plugins/huaweicloud-core/dist/auth/missing-credential-error.js +33 -0
  54. package/plugins/huaweicloud-core/dist/auth/obs-config.js +31 -0
  55. package/plugins/huaweicloud-core/dist/auth/project-id.js +90 -0
  56. package/plugins/huaweicloud-core/dist/auth/reconcile.js +256 -0
  57. package/plugins/huaweicloud-core/dist/auth/runtime-credentials.js +32 -0
  58. package/plugins/huaweicloud-core/dist/auth/s1-store.js +171 -0
  59. package/plugins/huaweicloud-core/dist/auth/service.js +397 -0
  60. package/plugins/huaweicloud-core/dist/auth/sts-expiry.js +58 -0
  61. package/plugins/huaweicloud-core/dist/capability-catalog.js +494 -0
  62. package/plugins/huaweicloud-core/dist/codearts-sandbox.js +32 -0
  63. package/plugins/huaweicloud-core/dist/codex-probe.js +77 -0
  64. package/plugins/huaweicloud-core/dist/data/icons-manifest.v1.json +3517 -0
  65. package/plugins/huaweicloud-core/dist/dep/installers/gateway.js +186 -0
  66. package/plugins/huaweicloud-core/dist/dep/installers/hcloud.js +370 -0
  67. package/plugins/huaweicloud-core/dist/dep/installers/table.js +28 -0
  68. package/plugins/huaweicloud-core/dist/dep/provision.js +247 -0
  69. package/plugins/huaweicloud-core/dist/dep/receipts.js +385 -0
  70. package/plugins/huaweicloud-core/dist/detect-framework-match.js +111 -0
  71. package/plugins/huaweicloud-core/dist/detect-framework-pkg.js +85 -0
  72. package/plugins/huaweicloud-core/dist/detect-framework-scan.js +93 -0
  73. package/plugins/huaweicloud-core/dist/detect-framework-table.js +153 -0
  74. package/plugins/huaweicloud-core/dist/detect-framework.js +7 -0
  75. package/plugins/huaweicloud-core/dist/doctor-native.js +167 -0
  76. package/plugins/huaweicloud-core/dist/doctor-payload.js +34 -0
  77. package/plugins/huaweicloud-core/dist/doctor-report.js +8 -0
  78. package/plugins/huaweicloud-core/dist/explain-error.js +209 -0
  79. package/plugins/huaweicloud-core/dist/hcloud-api-error.js +64 -0
  80. package/plugins/huaweicloud-core/dist/hcloud-catalog.js +91 -0
  81. package/plugins/huaweicloud-core/dist/hcloud-cli.js +24 -0
  82. package/plugins/huaweicloud-core/dist/hcloud-obs-redact.js +68 -0
  83. package/plugins/huaweicloud-core/dist/hcloud-plan.js +320 -0
  84. package/plugins/huaweicloud-core/dist/hcloud-probe.js +153 -0
  85. package/plugins/huaweicloud-core/dist/hcloud-run-once.js +245 -0
  86. package/plugins/huaweicloud-core/dist/hcloud-run.js +110 -0
  87. package/plugins/huaweicloud-core/dist/hcloud-sg-preflight.js +104 -0
  88. package/plugins/huaweicloud-core/dist/hcloud-sts.js +113 -0
  89. package/plugins/huaweicloud-core/dist/hcloud-triage.js +71 -0
  90. package/plugins/huaweicloud-core/dist/icon-library.js +216 -0
  91. package/plugins/huaweicloud-core/dist/install-payload.js +35 -0
  92. package/plugins/huaweicloud-core/dist/install-plan.js +85 -0
  93. package/plugins/huaweicloud-core/dist/install-prompts.js +119 -0
  94. package/plugins/huaweicloud-core/dist/koocli-version.js +83 -0
  95. package/plugins/huaweicloud-core/dist/lib/approval-tokens.js +353 -0
  96. package/plugins/huaweicloud-core/dist/lib/approvals-pin.js +128 -0
  97. package/plugins/huaweicloud-core/dist/lib/as-record.js +10 -0
  98. package/plugins/huaweicloud-core/dist/lib/as-text.js +15 -0
  99. package/plugins/huaweicloud-core/dist/lib/banner.js +10 -0
  100. package/plugins/huaweicloud-core/dist/lib/call-trace.js +128 -0
  101. package/plugins/huaweicloud-core/dist/lib/cli-io.js +72 -0
  102. package/plugins/huaweicloud-core/dist/lib/credentials.js +173 -0
  103. package/plugins/huaweicloud-core/dist/lib/dep-resolve.js +64 -0
  104. package/plugins/huaweicloud-core/dist/lib/dependency-model.js +152 -0
  105. package/plugins/huaweicloud-core/dist/lib/hdkit/hdkitservice-api.js +217 -0
  106. package/plugins/huaweicloud-core/dist/lib/hdkit/hwlink-api.js +163 -0
  107. package/plugins/huaweicloud-core/dist/lib/hdkit/sandbox-pool.js +303 -0
  108. package/plugins/huaweicloud-core/dist/lib/hw-request-signing.js +57 -0
  109. package/plugins/huaweicloud-core/dist/lib/koocli-paths.js +18 -0
  110. package/plugins/huaweicloud-core/dist/lib/native-receipt.js +110 -0
  111. package/plugins/huaweicloud-core/dist/lib/opencode-permission-seam.js +132 -0
  112. package/plugins/huaweicloud-core/dist/lib/pack-state.js +179 -0
  113. package/plugins/huaweicloud-core/dist/lib/pack-types.js +21 -0
  114. package/plugins/huaweicloud-core/dist/lib/secret-vault/cli.js +273 -0
  115. package/plugins/huaweicloud-core/dist/lib/secret-vault/custody.js +396 -0
  116. package/plugins/huaweicloud-core/dist/lib/secret-vault/refs.js +63 -0
  117. package/plugins/huaweicloud-core/dist/lib/secret-vault/store.js +236 -0
  118. package/plugins/huaweicloud-core/dist/lib/skill-frontmatter.js +158 -0
  119. package/plugins/huaweicloud-core/dist/lib/skill-manifest.js +55 -0
  120. package/plugins/huaweicloud-core/dist/lib/skill-tree.js +44 -0
  121. package/plugins/huaweicloud-core/dist/lib/tool-schema-parts.js +66 -0
  122. package/plugins/huaweicloud-core/dist/mcp-agent-config.js +80 -0
  123. package/plugins/huaweicloud-core/dist/mcp-config-backup.js +74 -0
  124. package/plugins/huaweicloud-core/dist/mcp-config-io.js +195 -0
  125. package/plugins/huaweicloud-core/dist/mcp-config-merge.js +188 -0
  126. package/plugins/huaweicloud-core/dist/mcp-protocol.js +320 -0
  127. package/plugins/huaweicloud-core/dist/mcp-server.js +62222 -0
  128. package/plugins/huaweicloud-core/dist/mcp-server.js.map +7 -0
  129. package/plugins/huaweicloud-core/dist/mcp-stdio-transport.js +206 -0
  130. package/plugins/huaweicloud-core/dist/officeace-paths.js +142 -0
  131. package/plugins/huaweicloud-core/dist/packs/auth/pack.js +11 -0
  132. package/plugins/huaweicloud-core/dist/packs/auth/tools.js +276 -0
  133. package/plugins/huaweicloud-core/dist/packs/discovery/pack.js +11 -0
  134. package/plugins/huaweicloud-core/dist/packs/discovery/tools.js +78 -0
  135. package/plugins/huaweicloud-core/dist/packs/enable.js +81 -0
  136. package/plugins/huaweicloud-core/dist/packs/huaweicloud-cli/pack.js +39 -0
  137. package/plugins/huaweicloud-core/dist/packs/huaweicloud-cli/tools.js +453 -0
  138. package/plugins/huaweicloud-core/dist/packs/huaweicloud-open-mcp/approval.js +222 -0
  139. package/plugins/huaweicloud-core/dist/packs/huaweicloud-open-mcp/pack.js +17 -0
  140. package/plugins/huaweicloud-core/dist/packs/huaweicloud-open-mcp/sidecar.js +486 -0
  141. package/plugins/huaweicloud-core/dist/packs/huaweicloud-open-mcp/tools.js +134 -0
  142. package/plugins/huaweicloud-core/dist/packs/obs/pack.js +11 -0
  143. package/plugins/huaweicloud-core/dist/packs/obs/tools.js +425 -0
  144. package/plugins/huaweicloud-core/dist/packs/registry.js +143 -0
  145. package/plugins/huaweicloud-core/dist/packs/sandbox/git-transfer.js +79 -0
  146. package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-account.js +80 -0
  147. package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-credentials.js +138 -0
  148. package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-deploy.js +45 -0
  149. package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-session.js +48 -0
  150. package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-tunnel.js +59 -0
  151. package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-upload.js +34 -0
  152. package/plugins/huaweicloud-core/dist/packs/sandbox/pack.js +14 -0
  153. package/plugins/huaweicloud-core/dist/packs/sandbox/schemas.js +191 -0
  154. package/plugins/huaweicloud-core/dist/packs/sandbox/tools.js +146 -0
  155. package/plugins/huaweicloud-core/dist/packs/secrets/pack.js +8 -0
  156. package/plugins/huaweicloud-core/dist/packs/secrets/tools.js +126 -0
  157. package/plugins/huaweicloud-core/dist/packs/update/pack.js +11 -0
  158. package/plugins/huaweicloud-core/dist/packs/update/tools.js +82 -0
  159. package/plugins/huaweicloud-core/dist/packs/voucher/pack.js +11 -0
  160. package/plugins/huaweicloud-core/dist/packs/voucher/tools.js +91 -0
  161. package/plugins/huaweicloud-core/dist/packs-cli/commands.js +108 -0
  162. package/plugins/huaweicloud-core/dist/packs-cli/doctor.js +81 -0
  163. package/plugins/huaweicloud-core/dist/packs-cli/report.js +133 -0
  164. package/plugins/huaweicloud-core/dist/packs-cli/slots.js +104 -0
  165. package/plugins/huaweicloud-core/dist/packs-cli/write-command.js +108 -0
  166. package/plugins/huaweicloud-core/dist/packs-cli/writers.js +115 -0
  167. package/plugins/huaweicloud-core/dist/packs-configure.js +81 -0
  168. package/plugins/huaweicloud-core/dist/packs-policy.js +149 -0
  169. package/plugins/huaweicloud-core/dist/payload-files.js +78 -0
  170. package/plugins/huaweicloud-core/dist/payload-native-clean.js +142 -0
  171. package/plugins/huaweicloud-core/dist/payload-native-sync.js +89 -0
  172. package/plugins/huaweicloud-core/dist/payload-placement.js +94 -0
  173. package/plugins/huaweicloud-core/dist/payload-roster.js +80 -0
  174. package/plugins/huaweicloud-core/dist/payload-runtime-deps.js +75 -0
  175. package/plugins/huaweicloud-core/dist/payload-status.js +43 -0
  176. package/plugins/huaweicloud-core/dist/payload-utils.js +42 -0
  177. package/plugins/huaweicloud-core/dist/preflight.js +232 -0
  178. package/plugins/huaweicloud-core/dist/proxy/cli.js +83 -0
  179. package/plugins/huaweicloud-core/dist/proxy/proxy-agent.js +92 -0
  180. package/plugins/huaweicloud-core/dist/proxy/proxy-bypass.js +83 -0
  181. package/plugins/huaweicloud-core/dist/proxy/proxy-cidr.js +105 -0
  182. package/plugins/huaweicloud-core/dist/proxy/proxy-config-io.js +61 -0
  183. package/plugins/huaweicloud-core/dist/proxy/proxy-config.js +10 -0
  184. package/plugins/huaweicloud-core/dist/risk-rule-engine.js +229 -0
  185. package/plugins/huaweicloud-core/dist/safety/classify-hcloud.js +191 -0
  186. package/plugins/huaweicloud-core/dist/safety/classify-text.js +1045 -0
  187. package/plugins/huaweicloud-core/dist/safety/command-operation.js +25 -0
  188. package/plugins/huaweicloud-core/dist/safety/credential-path.js +23 -0
  189. package/plugins/huaweicloud-core/dist/safety/default-policy.js +28 -0
  190. package/plugins/huaweicloud-core/dist/safety/feeder.js +119 -0
  191. package/plugins/huaweicloud-core/dist/safety/heredoc.js +95 -0
  192. package/plugins/huaweicloud-core/dist/safety/policy.js +76 -0
  193. package/plugins/huaweicloud-core/dist/safety/redact.js +42 -0
  194. package/plugins/huaweicloud-core/dist/safety/risk-merge.js +22 -0
  195. package/plugins/huaweicloud-core/dist/safety/script-stream.js +90 -0
  196. package/plugins/huaweicloud-core/dist/safety/secret-exec.js +44 -0
  197. package/plugins/huaweicloud-core/dist/safety/segments.js +138 -0
  198. package/plugins/huaweicloud-core/dist/safety/shell-text.js +414 -0
  199. package/plugins/huaweicloud-core/dist/safety/skill-quality-cli.js +152 -0
  200. package/plugins/huaweicloud-core/dist/safety/tokens.js +297 -0
  201. package/plugins/huaweicloud-core/dist/safety/unwrap.js +148 -0
  202. package/plugins/huaweicloud-core/dist/safety/vocabulary.js +37 -0
  203. package/plugins/huaweicloud-core/dist/safety/windows-rebase.js +56 -0
  204. package/plugins/huaweicloud-core/dist/safety/windows.js +137 -0
  205. package/plugins/huaweicloud-core/dist/safety/xargs-argv.js +64 -0
  206. package/plugins/huaweicloud-core/dist/safety-policy.js +14 -0
  207. package/plugins/huaweicloud-core/dist/sandbox/deploy-check.js +246 -0
  208. package/plugins/huaweicloud-core/dist/sandbox/deploy-nginx-verify.js +76 -0
  209. package/plugins/huaweicloud-core/dist/sandbox/deploy-nginx.js +215 -0
  210. package/plugins/huaweicloud-core/dist/sandbox/devbridge-auth.js +246 -0
  211. package/plugins/huaweicloud-core/dist/sandbox/devbridge-exec.js +10 -0
  212. package/plugins/huaweicloud-core/dist/sandbox/devbridge-expose-flow.js +225 -0
  213. package/plugins/huaweicloud-core/dist/sandbox/devbridge-expose.js +214 -0
  214. package/plugins/huaweicloud-core/dist/sandbox/devbridge-gateway.js +34 -0
  215. package/plugins/huaweicloud-core/dist/sandbox/devbridge-keepalive.js +212 -0
  216. package/plugins/huaweicloud-core/dist/sandbox/devbridge-key.js +175 -0
  217. package/plugins/huaweicloud-core/dist/sandbox/devbridge-renew.js +69 -0
  218. package/plugins/huaweicloud-core/dist/sandbox/devbridge-tunnel.js +48 -0
  219. package/plugins/huaweicloud-core/dist/sandbox/devbridge-validation.js +79 -0
  220. package/plugins/huaweicloud-core/dist/sandbox/devbridge-verify.js +101 -0
  221. package/plugins/huaweicloud-core/dist/sandbox/hwlink-connection.js +145 -0
  222. package/plugins/huaweicloud-core/dist/sandbox/sandbox-file-server.py +45 -0
  223. package/plugins/huaweicloud-core/dist/sandbox/sandbox-output.js +45 -0
  224. package/plugins/huaweicloud-core/dist/sandbox/session-manager.js +55 -0
  225. package/plugins/huaweicloud-core/dist/sandbox/tunnel-http.js +137 -0
  226. package/plugins/huaweicloud-core/dist/sandbox/uninstall-cleanup.js +45 -0
  227. package/plugins/huaweicloud-core/dist/sandbox/upload-diagnostics.js +45 -0
  228. package/plugins/huaweicloud-core/dist/sandbox/upload-file.js +119 -0
  229. package/plugins/huaweicloud-core/dist/sandbox/upload-project.js +171 -0
  230. package/plugins/huaweicloud-core/dist/sandbox/upload-transport.js +96 -0
  231. package/plugins/huaweicloud-core/dist/sandbox/ws-exec-loader.js +43 -0
  232. package/plugins/huaweicloud-core/dist/search-docs.js +64 -0
  233. package/plugins/huaweicloud-core/dist/search-market.js +277 -0
  234. package/plugins/huaweicloud-core/dist/services/availability.js +51 -0
  235. package/plugins/huaweicloud-core/dist/services/regions.js +110 -0
  236. package/plugins/huaweicloud-core/dist/setup-cli.js +1350 -0
  237. package/plugins/huaweicloud-core/dist/skill-disclosure.js +231 -0
  238. package/plugins/huaweicloud-core/dist/targets.js +139 -0
  239. package/plugins/huaweicloud-core/dist/telemetry/agent-detect.js +44 -0
  240. package/plugins/huaweicloud-core/dist/telemetry/agent-registry.js +196 -0
  241. package/plugins/huaweicloud-core/dist/telemetry/agent-versions-desktop.js +143 -0
  242. package/plugins/huaweicloud-core/dist/telemetry/agent-versions.js +78 -0
  243. package/plugins/huaweicloud-core/dist/telemetry/event-pipeline.js +206 -0
  244. package/plugins/huaweicloud-core/dist/telemetry/hook-ingest.js +81 -0
  245. package/plugins/huaweicloud-core/dist/telemetry/identity-stamps.js +104 -0
  246. package/plugins/huaweicloud-core/dist/telemetry/invoke-value.js +47 -0
  247. package/plugins/huaweicloud-core/dist/telemetry/telemetry-fs.js +42 -0
  248. package/plugins/huaweicloud-core/dist/telemetry/telemetry-types.js +14 -0
  249. package/plugins/huaweicloud-core/dist/telemetry/telemetry-values.js +121 -0
  250. package/plugins/huaweicloud-core/dist/telemetry/telemetry.js +262 -0
  251. package/plugins/huaweicloud-core/dist/tool-definitions.js +276 -0
  252. package/plugins/huaweicloud-core/dist/tool-schemas.js +156 -0
  253. package/plugins/huaweicloud-core/dist/tools.js +269 -0
  254. package/plugins/huaweicloud-core/dist/update-cache.js +79 -0
  255. package/plugins/huaweicloud-core/dist/update-check.js +23 -0
  256. package/plugins/huaweicloud-core/dist/update-hint.js +45 -0
  257. package/plugins/huaweicloud-core/dist/update-installed.js +53 -0
  258. package/plugins/huaweicloud-core/dist/update-registry.js +147 -0
  259. package/plugins/huaweicloud-core/dist/update-semver.js +76 -0
  260. package/plugins/huaweicloud-core/dist/update-skip.js +81 -0
  261. package/plugins/huaweicloud-core/dist/update-upgrade.js +101 -0
  262. package/plugins/huaweicloud-core/dist/vendor-gate.js +89 -0
  263. package/plugins/huaweicloud-core/dist/ws-exec/hwlink-exec-client.js +10 -0
  264. package/plugins/huaweicloud-core/dist/ws-exec/hwlink-exec-pending.js +71 -0
  265. package/plugins/huaweicloud-core/dist/ws-exec/hwlink-exec-session.js +235 -0
  266. package/plugins/huaweicloud-core/dist/ws-exec/hwlink-fair-queue.js +139 -0
  267. package/plugins/huaweicloud-core/dist/ws-exec/hwlink-interactive-terminal.js +106 -0
  268. package/plugins/huaweicloud-core/dist/ws-exec/hwlink-multiplexer.js +229 -0
  269. package/plugins/huaweicloud-core/dist/ws-exec/hwlink-normalize.js +53 -0
  270. package/plugins/huaweicloud-core/dist/ws-exec/hwlink-packet.js +148 -0
  271. package/plugins/huaweicloud-core/dist/ws-exec/hwlink-terminal-channel.js +155 -0
  272. package/plugins/huaweicloud-core/dist/ws-exec/hwlink-tunnel-channel.js +254 -0
  273. package/plugins/huaweicloud-core/dist/ws-exec/index.js +20 -0
  274. package/plugins/huaweicloud-core/dist/ws-exec/ws-exec-client.js +76 -0
  275. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.mjs +62 -3
  276. package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +2519 -33
  277. package/plugins/huaweicloud-core/openclaw.plugin.json +2 -2
  278. package/plugins/huaweicloud-core/safety/policy.json +53 -4
  279. package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +47 -9
  280. package/plugins/huaweicloud-core/skills/.manifest.json +67 -0
  281. package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +2 -0
  282. package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +2 -0
  283. package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +3 -1
  284. package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/SKILL.md +27 -51
  285. package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/acceptance-criteria.md +10 -12
  286. package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/cli-installation-guide.md +23 -27
  287. package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/dataflow-diagram.md +2 -0
  288. package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/iam-policies.md +2 -0
  289. package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/verification-method.md +8 -16
  290. package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/scripts/cli/cli_entry.py +71 -461
  291. package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/scripts/ensure_cli.sh +28 -68
  292. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/SKILL.md +56 -144
  293. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/acceptance-criteria.md +14 -12
  294. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/cli-installation-guide.md +72 -39
  295. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/dataflow-diagram.md +3 -1
  296. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/iam-policies.md +2 -0
  297. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/verification-method.md +12 -0
  298. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/scripts/cli/cli_entry.py +67 -307
  299. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/scripts/ensure_cli.sh +28 -68
  300. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/templates/test-defaults.json +1 -1
  301. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/templates/test-vars.json +9 -9
  302. package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/SKILL.md +82 -160
  303. package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/acceptance-criteria.md +9 -8
  304. package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/cli-installation-guide.md +73 -40
  305. package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/dataflow-diagram.md +4 -2
  306. package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/iam-policies.md +2 -0
  307. package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/related-commands.md +16 -14
  308. package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/verification-method.md +7 -20
  309. package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/scripts/cli/cli_entry.py +67 -307
  310. package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/scripts/ensure_cli.sh +28 -68
  311. package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/SKILL.md +92 -95
  312. package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/acceptance-criteria.md +11 -10
  313. package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/cli-installation-guide.md +86 -67
  314. package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/dataflow-diagram.md +4 -2
  315. package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/iam-policies.md +2 -0
  316. package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/test-data-guide.md +29 -25
  317. package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/verification-method.md +13 -11
  318. package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/scripts/cli/cli_entry.py +67 -307
  319. package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/scripts/ensure_cli.sh +28 -68
  320. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/SKILL.md +107 -127
  321. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/acceptance-criteria.md +26 -25
  322. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/cli-installation-guide.md +66 -51
  323. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/csms-usage.md +23 -19
  324. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/dataflow-diagram.md +4 -2
  325. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/iam-policies.md +25 -30
  326. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/kms-usage.md +13 -11
  327. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/verification-method.md +13 -7
  328. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/scripts/cli/cli_entry.py +67 -354
  329. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/scripts/ensure_cli.sh +28 -69
  330. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/templates/test-vars.json +11 -11
  331. package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +2 -0
  332. package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/SKILL.md +28 -109
  333. package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/acceptance-criteria.md +27 -31
  334. package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/cli-installation-guide.md +49 -24
  335. package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/dataflow-diagram.md +2 -5
  336. package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/iam-policies.md +2 -0
  337. package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/verification-method.md +8 -25
  338. package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/cli/cli_entry.py +67 -307
  339. package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/ensure_cli.sh +28 -68
  340. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/SKILL.md +60 -135
  341. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/acceptance-criteria.md +9 -11
  342. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/cli-installation-guide.md +16 -12
  343. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/dataflow-diagram.md +2 -0
  344. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/engine-operation-reference.md +15 -13
  345. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/iam-policies.md +9 -7
  346. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/security-audit-guide.md +9 -5
  347. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/verification-method.md +16 -37
  348. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/scripts/cli/cli_entry.py +101 -0
  349. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/scripts/ensure_cli.sh +27 -184
  350. package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/SKILL.md +71 -103
  351. package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/acceptance-criteria.md +4 -2
  352. package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/cli-installation-guide.md +72 -84
  353. package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/dataflow-diagram.md +3 -3
  354. package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/iam-policies.md +2 -0
  355. package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/related-commands.md +7 -5
  356. package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/verification-method.md +11 -9
  357. package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/scripts/cli/cli_entry.py +101 -0
  358. package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/scripts/ensure_cli.sh +27 -42
  359. package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +2 -0
  360. package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +24 -13
  361. package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +2 -0
  362. package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +2 -0
  363. package/plugins/huaweicloud-core/skills/huawei-ecs/references/hc-activity.md +2 -0
  364. package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +25 -21
  365. package/plugins/huaweicloud-core/skills/huawei-ecs/references/windows-ssh.md +7 -5
  366. package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +2 -0
  367. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +2 -0
  368. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +2 -0
  369. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +2 -0
  370. package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +2 -0
  371. package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +2 -0
  372. package/plugins/huaweicloud-core/skills/huawei-iac/SKILL.md +40 -38
  373. package/plugins/huaweicloud-core/skills/huawei-iac/references/architectures.md +2 -0
  374. package/plugins/huaweicloud-core/skills/huawei-iac/references/resource-catalog.md +14 -12
  375. package/plugins/huaweicloud-core/skills/huawei-iac/references/state-file.md +2 -0
  376. package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +3 -1
  377. package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +2 -0
  378. package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +4 -1
  379. package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +2 -0
  380. package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +32 -29
  381. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +2 -0
  382. package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +4 -2
  383. package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +17 -15
  384. package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +2 -0
  385. package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +10 -6
  386. package/plugins/huaweicloud-core/skills/huawei-openapi/SKILL.md +50 -0
  387. package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +15 -13
  388. package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +100 -93
  389. package/plugins/huaweicloud-core/skills/huawei-sandbox/references/framework-commands.md +2 -0
  390. package/plugins/huaweicloud-core/skills/huawei-sandbox/references/fullstack-postgrest.md +33 -27
  391. package/plugins/huaweicloud-core/skills/huawei-sandbox/references/nginx-templates.md +2 -0
  392. package/plugins/huaweicloud-core/skills/huawei-sandbox/references/resource-pool.md +7 -5
  393. package/plugins/huaweicloud-core/skills/huawei-sandbox/references/tunnel-persistence.md +9 -2
  394. package/plugins/huaweicloud-core/skills/huawei-voucher/SKILL.md +5 -3
  395. package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +3 -0
  396. package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +16 -0
  397. package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +2 -0
  398. package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +2 -0
  399. package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +3 -0
  400. package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +16 -13
  401. package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +10 -12
  402. package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +38 -37
  403. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +2 -0
  404. package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +2 -0
  405. package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +16 -6
  406. package/plugins/huaweicloud-core/skills/huaweicloud-safety/references/approvals.md +47 -0
  407. package/plugins/huaweicloud-core/skills/huaweicloud-safety/references/secrets.md +32 -0
  408. package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +2 -0
  409. package/plugins/huaweicloud-core/src/agents/atomcode.ts +138 -0
  410. package/plugins/huaweicloud-core/src/agents/codearts-work.ts +136 -0
  411. package/plugins/huaweicloud-core/src/agents/codearts.ts +92 -0
  412. package/plugins/huaweicloud-core/src/agents/codex-desktop.ts +219 -0
  413. package/plugins/huaweicloud-core/src/agents/codex.ts +230 -0
  414. package/plugins/huaweicloud-core/src/agents/dsh-patch.ts +195 -0
  415. package/plugins/huaweicloud-core/src/agents/dsh.ts +153 -0
  416. package/plugins/huaweicloud-core/src/agents/hermes-config.ts +974 -0
  417. package/plugins/huaweicloud-core/src/agents/hermes-hook-plugin.ts +99 -0
  418. package/plugins/huaweicloud-core/src/agents/hermes-hooks.ts +187 -0
  419. package/plugins/huaweicloud-core/src/agents/hermes-sdk.ts +63 -0
  420. package/plugins/huaweicloud-core/src/agents/hermes.ts +192 -0
  421. package/plugins/huaweicloud-core/src/agents/officeace-registry.ts +188 -0
  422. package/plugins/huaweicloud-core/src/agents/officeace-sqlite.ts +163 -0
  423. package/plugins/huaweicloud-core/src/agents/officeace.ts +202 -0
  424. package/plugins/huaweicloud-core/src/agents/openclaw.ts +73 -0
  425. package/plugins/huaweicloud-core/src/agents/opencode-config.ts +197 -0
  426. package/plugins/huaweicloud-core/src/agents/opencode.ts +148 -0
  427. package/plugins/huaweicloud-core/src/agents/workbuddy.ts +216 -0
  428. package/plugins/huaweicloud-core/src/approvals-cli.ts +187 -0
  429. package/plugins/huaweicloud-core/src/auth/account-type.ts +191 -0
  430. package/plugins/huaweicloud-core/src/auth/agent-registration.ts +267 -0
  431. package/plugins/huaweicloud-core/src/auth/cli.ts +133 -0
  432. package/plugins/huaweicloud-core/src/auth/codearts-context.ts +139 -0
  433. package/plugins/huaweicloud-core/src/auth/credential-placeholder.ts +36 -0
  434. package/plugins/huaweicloud-core/src/auth/credential-resolver.ts +81 -0
  435. package/plugins/huaweicloud-core/src/auth/credential-validator.ts +176 -0
  436. package/plugins/huaweicloud-core/src/auth/credentials.ts +52 -0
  437. package/plugins/huaweicloud-core/src/auth/{guidance.mjs → error-table.ts} +58 -12
  438. package/plugins/huaweicloud-core/src/auth/hcloud-profile.ts +119 -0
  439. package/plugins/huaweicloud-core/src/auth/init-cli.ts +155 -0
  440. package/plugins/huaweicloud-core/src/auth/missing-credential-error.ts +44 -0
  441. package/plugins/huaweicloud-core/src/auth/obs-config.ts +42 -0
  442. package/plugins/huaweicloud-core/src/auth/project-id.ts +104 -0
  443. package/plugins/huaweicloud-core/src/auth/reconcile.ts +345 -0
  444. package/plugins/huaweicloud-core/src/auth/runtime-credentials.ts +38 -0
  445. package/plugins/huaweicloud-core/src/auth/s1-store.ts +214 -0
  446. package/plugins/huaweicloud-core/src/auth/{service.mjs → service.ts} +210 -36
  447. package/plugins/huaweicloud-core/src/auth/sts-expiry.ts +58 -0
  448. package/plugins/huaweicloud-core/src/capability-catalog.ts +519 -0
  449. package/plugins/huaweicloud-core/src/codearts-sandbox.ts +32 -0
  450. package/plugins/huaweicloud-core/src/codex-probe.ts +86 -0
  451. package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +5 -23
  452. package/plugins/huaweicloud-core/src/dep/installers/gateway.ts +213 -0
  453. package/plugins/huaweicloud-core/src/dep/installers/hcloud.ts +407 -0
  454. package/plugins/huaweicloud-core/src/dep/installers/table.ts +123 -0
  455. package/plugins/huaweicloud-core/src/dep/provision.ts +335 -0
  456. package/plugins/huaweicloud-core/src/dep/receipts.ts +464 -0
  457. package/plugins/huaweicloud-core/src/detect-framework-match.ts +143 -0
  458. package/plugins/huaweicloud-core/src/detect-framework-pkg.ts +79 -0
  459. package/plugins/huaweicloud-core/src/detect-framework-scan.ts +117 -0
  460. package/plugins/huaweicloud-core/src/detect-framework-table.ts +166 -0
  461. package/plugins/huaweicloud-core/src/detect-framework.ts +8 -0
  462. package/plugins/huaweicloud-core/src/doctor-native.ts +189 -0
  463. package/plugins/huaweicloud-core/src/doctor-payload.ts +77 -0
  464. package/plugins/huaweicloud-core/src/doctor-report.ts +30 -0
  465. package/plugins/huaweicloud-core/src/explain-error.ts +246 -0
  466. package/plugins/huaweicloud-core/src/hcloud-api-error.ts +69 -0
  467. package/plugins/huaweicloud-core/src/hcloud-catalog.ts +115 -0
  468. package/plugins/huaweicloud-core/src/hcloud-cli.ts +41 -0
  469. package/plugins/huaweicloud-core/src/hcloud-obs-redact.ts +65 -0
  470. package/plugins/huaweicloud-core/src/hcloud-plan.ts +383 -0
  471. package/plugins/huaweicloud-core/src/{hcloud-probe.mjs → hcloud-probe.ts} +87 -60
  472. package/plugins/huaweicloud-core/src/hcloud-run-once.ts +251 -0
  473. package/plugins/huaweicloud-core/src/hcloud-run.ts +154 -0
  474. package/plugins/huaweicloud-core/src/hcloud-sg-preflight.ts +111 -0
  475. package/plugins/huaweicloud-core/src/hcloud-sts.ts +123 -0
  476. package/plugins/huaweicloud-core/src/hcloud-triage.ts +80 -0
  477. package/plugins/huaweicloud-core/src/{icon-library.mjs → icon-library.ts} +115 -23
  478. package/plugins/huaweicloud-core/src/install-payload.ts +63 -0
  479. package/plugins/huaweicloud-core/src/install-plan.ts +85 -0
  480. package/plugins/huaweicloud-core/src/install-prompts.ts +134 -0
  481. package/plugins/huaweicloud-core/src/koocli-version.ts +87 -0
  482. package/plugins/huaweicloud-core/src/lib/approval-tokens.ts +496 -0
  483. package/plugins/huaweicloud-core/src/lib/approvals-pin.ts +153 -0
  484. package/plugins/huaweicloud-core/src/lib/as-record.ts +10 -0
  485. package/plugins/huaweicloud-core/src/lib/as-text.ts +16 -0
  486. package/plugins/huaweicloud-core/src/lib/banner.ts +12 -0
  487. package/plugins/huaweicloud-core/src/lib/call-trace.ts +153 -0
  488. package/plugins/huaweicloud-core/src/lib/cli-io.ts +81 -0
  489. package/plugins/huaweicloud-core/src/lib/credentials.ts +202 -0
  490. package/plugins/huaweicloud-core/src/lib/dep-resolve.ts +107 -0
  491. package/plugins/huaweicloud-core/src/lib/dependency-model.ts +236 -0
  492. package/plugins/huaweicloud-core/src/lib/hdkit/hdkitservice-api.ts +255 -0
  493. package/plugins/huaweicloud-core/src/lib/hdkit/hwlink-api.ts +245 -0
  494. package/plugins/huaweicloud-core/src/{sandbox/sandbox-pool.mjs → lib/hdkit/sandbox-pool.ts} +126 -47
  495. package/plugins/huaweicloud-core/src/lib/hw-request-signing.ts +101 -0
  496. package/plugins/huaweicloud-core/src/lib/koocli-paths.ts +21 -0
  497. package/plugins/huaweicloud-core/src/lib/native-receipt.ts +131 -0
  498. package/plugins/huaweicloud-core/src/lib/opencode-permission-seam.ts +145 -0
  499. package/plugins/huaweicloud-core/src/lib/pack-state.ts +192 -0
  500. package/plugins/huaweicloud-core/src/lib/pack-types.ts +74 -0
  501. package/plugins/huaweicloud-core/src/lib/secret-vault/cli.ts +270 -0
  502. package/plugins/huaweicloud-core/src/lib/secret-vault/custody.ts +468 -0
  503. package/plugins/huaweicloud-core/src/lib/secret-vault/refs.ts +75 -0
  504. package/plugins/huaweicloud-core/src/lib/secret-vault/store.ts +357 -0
  505. package/plugins/huaweicloud-core/src/lib/skill-frontmatter.ts +164 -0
  506. package/plugins/huaweicloud-core/src/lib/skill-manifest.ts +55 -0
  507. package/plugins/huaweicloud-core/src/lib/skill-tree.ts +45 -0
  508. package/plugins/huaweicloud-core/src/lib/tool-schema-parts.ts +80 -0
  509. package/plugins/huaweicloud-core/src/mcp-agent-config.ts +90 -0
  510. package/plugins/huaweicloud-core/src/{mcp-config-backup.mjs → mcp-config-backup.ts} +14 -10
  511. package/plugins/huaweicloud-core/src/mcp-config-io.ts +215 -0
  512. package/plugins/huaweicloud-core/src/mcp-config-merge.ts +205 -0
  513. package/plugins/huaweicloud-core/src/mcp-protocol.ts +385 -0
  514. package/plugins/huaweicloud-core/src/mcp-server-remote.ts +178 -0
  515. package/plugins/huaweicloud-core/src/mcp-server.ts +87 -0
  516. package/plugins/huaweicloud-core/src/mcp-stdio-transport.ts +245 -0
  517. package/plugins/huaweicloud-core/src/officeace-paths.ts +146 -0
  518. package/plugins/huaweicloud-core/src/packs/auth/pack.ts +14 -0
  519. package/plugins/huaweicloud-core/src/packs/auth/tools.ts +327 -0
  520. package/plugins/huaweicloud-core/src/packs/discovery/pack.ts +14 -0
  521. package/plugins/huaweicloud-core/src/packs/discovery/tools.ts +97 -0
  522. package/plugins/huaweicloud-core/src/packs/enable.ts +90 -0
  523. package/plugins/huaweicloud-core/src/packs/huaweicloud-cli/pack.ts +42 -0
  524. package/plugins/huaweicloud-core/src/packs/huaweicloud-cli/tools.ts +513 -0
  525. package/plugins/huaweicloud-core/src/packs/huaweicloud-open-mcp/approval.ts +250 -0
  526. package/plugins/huaweicloud-core/src/packs/huaweicloud-open-mcp/pack.ts +19 -0
  527. package/plugins/huaweicloud-core/src/packs/huaweicloud-open-mcp/sidecar.ts +603 -0
  528. package/plugins/huaweicloud-core/src/packs/huaweicloud-open-mcp/tools.ts +155 -0
  529. package/plugins/huaweicloud-core/src/packs/obs/pack.ts +13 -0
  530. package/plugins/huaweicloud-core/src/packs/obs/tools.ts +487 -0
  531. package/plugins/huaweicloud-core/src/packs/registry.ts +162 -0
  532. package/plugins/huaweicloud-core/src/packs/sandbox/git-transfer.ts +93 -0
  533. package/plugins/huaweicloud-core/src/packs/sandbox/handlers-account.ts +93 -0
  534. package/plugins/huaweicloud-core/src/packs/sandbox/handlers-credentials.ts +144 -0
  535. package/plugins/huaweicloud-core/src/packs/sandbox/handlers-deploy.ts +63 -0
  536. package/plugins/huaweicloud-core/src/packs/sandbox/handlers-session.ts +59 -0
  537. package/plugins/huaweicloud-core/src/packs/sandbox/handlers-tunnel.ts +101 -0
  538. package/plugins/huaweicloud-core/src/packs/sandbox/handlers-upload.ts +46 -0
  539. package/plugins/huaweicloud-core/src/packs/sandbox/pack.ts +16 -0
  540. package/plugins/huaweicloud-core/src/packs/sandbox/schemas.ts +249 -0
  541. package/plugins/huaweicloud-core/src/packs/sandbox/tools.ts +183 -0
  542. package/plugins/huaweicloud-core/src/packs/secrets/pack.ts +11 -0
  543. package/plugins/huaweicloud-core/src/packs/secrets/tools.ts +146 -0
  544. package/plugins/huaweicloud-core/src/packs/update/pack.ts +13 -0
  545. package/plugins/huaweicloud-core/src/packs/update/tools.ts +107 -0
  546. package/plugins/huaweicloud-core/src/packs/voucher/pack.ts +13 -0
  547. package/plugins/huaweicloud-core/src/packs/voucher/tools.ts +112 -0
  548. package/plugins/huaweicloud-core/src/packs-cli/commands.ts +121 -0
  549. package/plugins/huaweicloud-core/src/packs-cli/doctor.ts +85 -0
  550. package/plugins/huaweicloud-core/src/packs-cli/report.ts +171 -0
  551. package/plugins/huaweicloud-core/src/packs-cli/slots.ts +139 -0
  552. package/plugins/huaweicloud-core/src/packs-cli/write-command.ts +114 -0
  553. package/plugins/huaweicloud-core/src/packs-cli/writers.ts +125 -0
  554. package/plugins/huaweicloud-core/src/packs-configure.ts +104 -0
  555. package/plugins/huaweicloud-core/src/packs-policy.ts +203 -0
  556. package/plugins/huaweicloud-core/src/payload-files.ts +78 -0
  557. package/plugins/huaweicloud-core/src/payload-native-clean.ts +154 -0
  558. package/plugins/huaweicloud-core/src/payload-native-sync.ts +110 -0
  559. package/plugins/huaweicloud-core/src/payload-placement.ts +107 -0
  560. package/plugins/huaweicloud-core/src/payload-roster.ts +85 -0
  561. package/plugins/huaweicloud-core/src/payload-runtime-deps.ts +76 -0
  562. package/plugins/huaweicloud-core/src/payload-status.ts +53 -0
  563. package/plugins/huaweicloud-core/src/payload-utils.ts +51 -0
  564. package/plugins/huaweicloud-core/src/preflight.ts +250 -0
  565. package/plugins/huaweicloud-core/src/proxy/cli.ts +103 -0
  566. package/plugins/huaweicloud-core/src/proxy/{proxy-agent.mjs → proxy-agent.ts} +25 -16
  567. package/plugins/huaweicloud-core/src/proxy/proxy-bypass.ts +90 -0
  568. package/plugins/huaweicloud-core/src/proxy/proxy-cidr.ts +98 -0
  569. package/plugins/huaweicloud-core/src/proxy/proxy-config-io.ts +73 -0
  570. package/plugins/huaweicloud-core/src/proxy/proxy-config.ts +18 -0
  571. package/plugins/huaweicloud-core/src/risk-rule-engine.ts +325 -0
  572. package/plugins/huaweicloud-core/src/safety/classify-hcloud.ts +246 -0
  573. package/plugins/huaweicloud-core/src/safety/classify-text.ts +1114 -0
  574. package/plugins/huaweicloud-core/src/safety/command-operation.ts +28 -0
  575. package/plugins/huaweicloud-core/src/safety/credential-path.ts +25 -0
  576. package/plugins/huaweicloud-core/src/safety/default-policy.ts +34 -0
  577. package/plugins/huaweicloud-core/src/safety/feeder.ts +140 -0
  578. package/plugins/huaweicloud-core/src/safety/heredoc.ts +100 -0
  579. package/plugins/huaweicloud-core/src/safety/policy.ts +111 -0
  580. package/plugins/huaweicloud-core/src/safety/redact.ts +63 -0
  581. package/plugins/huaweicloud-core/src/safety/risk-merge.ts +31 -0
  582. package/plugins/huaweicloud-core/src/safety/script-stream.ts +95 -0
  583. package/plugins/huaweicloud-core/src/safety/secret-exec.ts +42 -0
  584. package/plugins/huaweicloud-core/src/safety/segments.ts +153 -0
  585. package/plugins/huaweicloud-core/src/safety/shell-text.ts +415 -0
  586. package/plugins/huaweicloud-core/src/safety/skill-quality-cli.ts +141 -0
  587. package/plugins/huaweicloud-core/src/safety/tokens.ts +322 -0
  588. package/plugins/huaweicloud-core/src/safety/unwrap.ts +162 -0
  589. package/plugins/huaweicloud-core/src/safety/vocabulary.ts +38 -0
  590. package/plugins/huaweicloud-core/src/safety/windows-rebase.ts +56 -0
  591. package/plugins/huaweicloud-core/src/safety/windows.ts +133 -0
  592. package/plugins/huaweicloud-core/src/safety/xargs-argv.ts +79 -0
  593. package/plugins/huaweicloud-core/src/safety-policy.ts +16 -0
  594. package/plugins/huaweicloud-core/src/sandbox/deploy-check.ts +307 -0
  595. package/plugins/huaweicloud-core/src/sandbox/deploy-nginx-verify.ts +96 -0
  596. package/plugins/huaweicloud-core/src/sandbox/deploy-nginx.ts +300 -0
  597. package/plugins/huaweicloud-core/src/sandbox/devbridge-auth.ts +291 -0
  598. package/plugins/huaweicloud-core/src/sandbox/devbridge-exec.ts +28 -0
  599. package/plugins/huaweicloud-core/src/sandbox/devbridge-expose-flow.ts +289 -0
  600. package/plugins/huaweicloud-core/src/sandbox/devbridge-expose.ts +310 -0
  601. package/plugins/huaweicloud-core/src/sandbox/devbridge-gateway.ts +36 -0
  602. package/plugins/huaweicloud-core/src/sandbox/devbridge-keepalive.ts +254 -0
  603. package/plugins/huaweicloud-core/src/sandbox/{devbridge-key.mjs → devbridge-key.ts} +48 -32
  604. package/plugins/huaweicloud-core/src/sandbox/devbridge-renew.ts +87 -0
  605. package/plugins/huaweicloud-core/src/sandbox/devbridge-tunnel.ts +79 -0
  606. package/plugins/huaweicloud-core/src/sandbox/devbridge-validation.ts +100 -0
  607. package/plugins/huaweicloud-core/src/sandbox/devbridge-verify.ts +120 -0
  608. package/plugins/huaweicloud-core/src/sandbox/hwlink-connection.ts +188 -0
  609. package/plugins/huaweicloud-core/src/sandbox/sandbox-output.ts +46 -0
  610. package/plugins/huaweicloud-core/src/sandbox/session-manager.ts +89 -0
  611. package/plugins/huaweicloud-core/src/sandbox/tunnel-http.ts +155 -0
  612. package/plugins/huaweicloud-core/src/sandbox/{uninstall-cleanup.mjs → uninstall-cleanup.ts} +4 -4
  613. package/plugins/huaweicloud-core/src/sandbox/upload-diagnostics.ts +46 -0
  614. package/plugins/huaweicloud-core/src/sandbox/upload-file.ts +161 -0
  615. package/plugins/huaweicloud-core/src/sandbox/upload-project.ts +218 -0
  616. package/plugins/huaweicloud-core/src/sandbox/upload-transport.ts +150 -0
  617. package/plugins/huaweicloud-core/src/sandbox/ws-exec-loader.ts +104 -0
  618. package/plugins/huaweicloud-core/src/search-docs.ts +64 -0
  619. package/plugins/huaweicloud-core/src/{search-market.mjs → search-market.ts} +96 -28
  620. package/plugins/huaweicloud-core/src/services/availability.ts +53 -0
  621. package/plugins/huaweicloud-core/src/services/regions.ts +110 -0
  622. package/plugins/huaweicloud-core/src/setup-cli.ts +1570 -0
  623. package/plugins/huaweicloud-core/src/skill-disclosure.ts +242 -0
  624. package/plugins/huaweicloud-core/src/targets.ts +156 -0
  625. package/plugins/huaweicloud-core/src/telemetry/{agent-detect.mjs → agent-detect.ts} +16 -5
  626. package/plugins/huaweicloud-core/src/telemetry/agent-registry.ts +210 -0
  627. package/plugins/huaweicloud-core/src/telemetry/agent-versions-desktop.ts +138 -0
  628. package/plugins/huaweicloud-core/src/telemetry/agent-versions.ts +84 -0
  629. package/plugins/huaweicloud-core/src/telemetry/event-pipeline.ts +214 -0
  630. package/plugins/huaweicloud-core/src/telemetry/hook-ingest.ts +82 -0
  631. package/plugins/huaweicloud-core/src/telemetry/identity-stamps.ts +108 -0
  632. package/plugins/huaweicloud-core/src/telemetry/invoke-value.ts +47 -0
  633. package/plugins/huaweicloud-core/src/telemetry/telemetry-fs.ts +47 -0
  634. package/plugins/huaweicloud-core/src/telemetry/telemetry-types.ts +97 -0
  635. package/plugins/huaweicloud-core/src/telemetry/telemetry-values.ts +116 -0
  636. package/plugins/huaweicloud-core/src/telemetry/telemetry.ts +299 -0
  637. package/plugins/huaweicloud-core/src/tool-definitions.ts +294 -0
  638. package/plugins/huaweicloud-core/src/tool-schemas.ts +180 -0
  639. package/plugins/huaweicloud-core/src/tools.ts +417 -0
  640. package/plugins/huaweicloud-core/src/update-cache.ts +95 -0
  641. package/plugins/huaweicloud-core/src/update-check.ts +51 -0
  642. package/plugins/huaweicloud-core/src/update-hint.ts +82 -0
  643. package/plugins/huaweicloud-core/src/update-installed.ts +53 -0
  644. package/plugins/huaweicloud-core/src/update-registry.ts +152 -0
  645. package/plugins/huaweicloud-core/src/update-semver.ts +80 -0
  646. package/plugins/huaweicloud-core/src/update-skip.ts +94 -0
  647. package/plugins/huaweicloud-core/src/update-upgrade.ts +130 -0
  648. package/plugins/huaweicloud-core/src/vendor-gate.ts +103 -0
  649. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.ts +15 -0
  650. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-pending.ts +113 -0
  651. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-session.ts +334 -0
  652. package/plugins/huaweicloud-core/src/ws-exec/{hwlink-fair-queue.js → hwlink-fair-queue.ts} +46 -15
  653. package/plugins/huaweicloud-core/src/ws-exec/hwlink-interactive-terminal.ts +158 -0
  654. package/plugins/huaweicloud-core/src/ws-exec/{hwlink-multiplexer.js → hwlink-multiplexer.ts} +108 -30
  655. package/plugins/huaweicloud-core/src/ws-exec/hwlink-normalize.ts +60 -0
  656. package/plugins/huaweicloud-core/src/ws-exec/{hwlink-packet.js → hwlink-packet.ts} +40 -16
  657. package/plugins/huaweicloud-core/src/ws-exec/{hwlink-terminal-channel.js → hwlink-terminal-channel.ts} +30 -18
  658. package/plugins/huaweicloud-core/src/ws-exec/{hwlink-tunnel-channel.mjs → hwlink-tunnel-channel.ts} +75 -27
  659. package/plugins/huaweicloud-core/src/ws-exec/{index.js → index.ts} +11 -11
  660. package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.ts +102 -0
  661. package/plugins/huaweicloud-core/tsconfig.json +21 -0
  662. package/rules/huawei-agent-rules.mdc +2 -2
  663. package/integrations/hermes/skills-snapshot.json +0 -175
  664. package/integrations/opencode/skills/huaweicloud-core/SKILL.md +0 -32
  665. package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/scripts/cli/cli_reporting.py +0 -589
  666. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/test-report.md +0 -35
  667. package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/scripts/cli/cli_reporting.py +0 -928
  668. package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/scripts/cli/cli_reporting.py +0 -928
  669. package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/test-report.md +0 -52
  670. package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/scripts/cli/cli_reporting.py +0 -928
  671. package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/scripts/cli/cli_reporting.py +0 -577
  672. package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/cli/cli_reporting.py +0 -928
  673. package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/gaussdb_cli.sh +0 -138
  674. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/scripts/install_cli.sh +0 -94
  675. package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/scripts/smn_dms_skill.py +0 -444
  676. package/plugins/huaweicloud-core/src/account-type.mjs +0 -135
  677. package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +0 -243
  678. package/plugins/huaweicloud-core/src/auth/credential-validator.mjs +0 -198
  679. package/plugins/huaweicloud-core/src/auth/credentials.mjs +0 -446
  680. package/plugins/huaweicloud-core/src/auth/project-id.mjs +0 -68
  681. package/plugins/huaweicloud-core/src/auth/reconcile.mjs +0 -257
  682. package/plugins/huaweicloud-core/src/auto-upgrade-runner.mjs +0 -58
  683. package/plugins/huaweicloud-core/src/detect-framework.mjs +0 -402
  684. package/plugins/huaweicloud-core/src/hcloud-cli.mjs +0 -825
  685. package/plugins/huaweicloud-core/src/koocli-version.mjs +0 -47
  686. package/plugins/huaweicloud-core/src/mcp-config-merge.mjs +0 -219
  687. package/plugins/huaweicloud-core/src/mcp-protocol.mjs +0 -118
  688. package/plugins/huaweicloud-core/src/mcp-server-remote.mjs +0 -108
  689. package/plugins/huaweicloud-core/src/mcp-server.mjs +0 -233
  690. package/plugins/huaweicloud-core/src/officeace-paths.mjs +0 -51
  691. package/plugins/huaweicloud-core/src/preflight.mjs +0 -125
  692. package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +0 -187
  693. package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +0 -182
  694. package/plugins/huaweicloud-core/src/safety-policy.mjs +0 -625
  695. package/plugins/huaweicloud-core/src/sandbox/hdkitservice-api.mjs +0 -293
  696. package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +0 -224
  697. package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +0 -2594
  698. package/plugins/huaweicloud-core/src/setup-cli.mjs +0 -5379
  699. package/plugins/huaweicloud-core/src/telemetry/agent-registry.mjs +0 -341
  700. package/plugins/huaweicloud-core/src/telemetry/telemetry.mjs +0 -492
  701. package/plugins/huaweicloud-core/src/tools.mjs +0 -3211
  702. package/plugins/huaweicloud-core/src/update-auto.mjs +0 -669
  703. package/plugins/huaweicloud-core/src/update-check.mjs +0 -607
  704. package/plugins/huaweicloud-core/src/update-policy.mjs +0 -82
  705. package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +0 -461
  706. package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +0 -365
@@ -1,9 +1,11 @@
1
1
  ---
2
2
  name: huawei-sandbox
3
- description: 'Use when creating, connecting, or managing Huawei Cloud Sandbox instances and workspace terminals, or when a task needs a temporary runtime to deploy, run, or preview a web application, backend service, or full-stack workbench. Covers sandbox lifecycle (check-user, sign-agreement, connect, release), session-based terminal execution, and credential injection. Triggers on: sandbox, workspace, terminal, web app deployment, deploy web app, preview app, deploy github, github repo, deploy repo, website, static site, web application, backend service, 工作台, workbench, full-stack, 全栈, CRUD 应用, database-backed REST API, PostgREST, postgres, hwlink, devstation, hdkitservice, remote exec. NOT for: ECS instances (use huawei-ecs), CCE clusters (use huawei-cce).'
3
+ description: 'Use when creating, connecting, or managing Huawei Cloud Sandbox instances and workspace terminals, or when a Huawei Cloud task needs a temporary runtime to deploy, run, or preview a web application. A request that names no cloud vendor is not thereby a Huawei Cloud task: when the vendor is unknown and cannot be inferred, ask which cloud the user means before routing here — deployment/website vocabulary alone is not vendor evidence. Cloud-facing tools take a vendorConfirmed parameter — pass the user’s establishing words, never an invented quote. Covers sandbox lifecycle (check-user, sign-agreement, connect, release), session-based terminal execution, and credential injection. Triggers on: sandbox, workspace, terminal, web app deployment, deploy web app, preview app, deploy github, github repo, deploy repo, website, static site, web application, backend service, 工作台, workbench, full-stack, 全栈, CRUD 应用, database-backed REST API, PostgREST, postgres, hwlink, devstation, hdkitservice, remote exec. NOT for: ECS instances (use huawei-ecs), CCE clusters (use huawei-cce).'
4
4
  version: 1
5
5
  ---
6
6
 
7
+ <!-- generated from src/packs/sandbox/skills/huawei-sandbox - do not edit -->
8
+
7
9
  # Huawei Cloud Sandbox
8
10
 
9
11
  **STOP - Do not answer from general knowledge.** Follow the procedure below.
@@ -51,7 +53,7 @@ Domain expertise for Huawei Cloud Sandbox (DevStation) instances and workspace t
51
53
 
52
54
  > 口径基调:一切以实测为准,口头支持不作数(下表生命周期为实测/平台侧现状;数值为服务端配置下发的默认口径,平台调参以服务端回显为准)。
53
55
 
54
- `huaweicloud_sandbox_connect` 用 `pool_type` 选择资源池(服务端权威映射模板;**没有 persist_mode 参数**;客户端不再支持传 template_id/自定义模板):
56
+ `huaweicloud_sandbox_connect` 用 `pool_type` 选择资源池(服务端权威映射模板;**没有 persist_mode 参数**——上游参数面仅 template_id/flavor_id):
55
57
 
56
58
  | pool_type | 语义 | 生命周期(平台策略) | 适用 |
57
59
  | ------------------- | ------------------ | ------------------------------------------------------------ | --------------------------- |
@@ -74,13 +76,13 @@ Selection rules(agent 按意图自动选池,开发者可覆盖;意图不
74
76
  - **TTL 播报**:仅 connect(会话首次连接 / 复用被唤醒 `started=true`)与 expose_tunnel(交付地址时)返回生命周期提示;其余执行类工具不逐次播报。**ephemeral 池部署的公网地址会随沙箱闲置关机失效**,向开发者交付 URL 时必须转述 `urlLifetimeHint` / `warnings` 中的存活期提示(隧道有效期 ≠ 沙箱存活期)。数值以服务端回显为准,缺失时用默认口径兜底
75
77
  - **烧核播报口径**:沙箱运行消耗核时,播报用「平台赠送 + 活动赚取」口径(非直接计费);账号核时耗尽(`HD.97520422`)时工具返回值给出友好引导
76
78
  - **删除纪律**:不向开发者暴露生命周期删除 API(回收走平台闲置策略 G1);开发者主动删除时必须二次确认(确认要删除?数据不可恢复);绝不做延后代删
77
- - 不支持传 `template_id`;自定义模板已下线,客户端只传 `pool_type`
79
+ - 显式 `template_id` 优先于 `pool_type`(自定义模板场景)
78
80
  - 完整口径、容量规划与 G 清单:[references/resource-pool.md](references/resource-pool.md)
79
81
 
80
82
  ## Activation
81
83
 
82
- - **Proactive offering**: when the developer's task needs a temporary runtime (e.g. "deploy this web app", "run this app and preview it"), offer the sandbox proactively — the developer never has to say "use sandbox". Prompt: "This task can be satisfied by a sandbox — use it?"
83
- - **Static website hosting — present options, sandbox first (MANDATORY)**: when the developer asks to deploy/host/publish a static website or web app without naming a target, do NOT silently pick a service and do NOT default to the sandbox. Run the [Target-Selection Gate](#target-selection-gate-mandatory--do-not-skip) via the `question` tool first. Present, in order: ① 沙箱 (recommended — temporary runtime, instant preview URL) ② OBS 静态托管 (long-term static hosting/CDN; 需提前准备好自定义域名) ③ ECS (需搭配弹性公网IP/EIP 才能公网访问) ④ CCE. Recommended prompt: "建议优先部署到沙箱(临时运行环境,可预览访问),也可选择 OBS 静态托管(需提前准备好自定义域名)、ECS(需搭配弹性公网IP/EIP)或 CCE,你想部署到哪里?" Only if the developer, after being asked, expresses no preference may you proceed with the sandbox.
84
+ - **Proactive offering**: when the developer's Huawei Cloud task needs a temporary runtime (e.g. "deploy this web app", "run this app and preview it"), offer the sandbox proactively — the developer never has to say "use sandbox". A task whose cloud vendor is unknown or named as another cloud is out of scope here; settle the vendor first. Prompt: "This task can be satisfied by a sandbox — use it?"
85
+ - **Static website hosting — present options, sandbox first (MANDATORY)**: when the developer asks to deploy/host/publish a static website or web app without naming a target, do NOT silently pick a service and do NOT default to the sandbox. Run the [Target-Selection Gate](#target-selection-gate-mandatory--do-not-skip) via the `question` tool first. Present, in order: ① 沙箱 (recommended — temporary runtime, instant preview URL) ② OBS 静态托管 (long-term static hosting/CDN; 需提前准备好自定义域名) ③ ECS (需搭配弹性公网IP/EIP 才能公网访问) ④ CCE. Recommended prompt: "建议优先部署到沙箱(临时运行环境,可预览访问),也可选择 OBS 静态托管(需提前准备好自定义域名)、ECS(需搭配弹性公网IP/EIP 才能公网访问)或 CCE,你想部署到哪里?" Only if the developer, after being asked, expresses no preference may you proceed with the sandbox.
84
86
  - **Detect web apps in deploy-a-repo prompts**: prompts like "部署 GitHub - <owner>/<repo>" or "deploy <github repo>" do not say "web app". Clone or inspect the repository first (package.json with dev/serve/build scripts, index.html, frontend framework dependencies such as vue/react/angular/vite, static sites, Dockerfile running a web server). If it is a web application, offer the sandbox first: "检测到该项目是 Web 应用,建议优先使用沙箱部署(临时运行环境,可预览访问),是否使用?"
85
87
  - **Clone into the sandbox workspace directory**: always put project code under `/workspace/<repo-name>` (create the directory if missing) — `/workspace` is the sandbox's dedicated workspace mount at the filesystem root, not `$HOME/workspace`. Never use `/tmp` or other ephemeral locations. This keeps the project with the sandbox session, is easy to reference for serving/exposing, and survives session-level restarts of the shell.
86
88
  - **Deployment must end with a public URL**: after deploying and exposing the app with DevBridge, always return the tunnel URL to the developer as the final result — a deployment without an accessible link is incomplete.
@@ -111,11 +113,11 @@ Selection rules(agent 按意图自动选池,开发者可覆盖;意图不
111
113
 
112
114
  ### Tunnel Persistence (public URL lifetime)
113
115
 
114
- | Tool | Purpose |
115
- | ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
116
- | `huaweicloud_sandbox_expose_tunnel` | Expose a port → public tunnel URL (auth, pre-clean, health check; `expiry_hours` 1-720, def 72). **AUTO-enrolls into the keepalive watchdog** (merged into existing coverage; `keepalive: false` opts out) |
117
- | `huaweicloud_sandbox_renew_tunnel` | Renew a tunnel lifetime (`update -e`, rolling window; returns absolute expiresAt) |
118
- | `huaweicloud_sandbox_keepalive_watchdog` | Install/replace the 3-layer watchdog: host re-attach + daily 720h renewal + 5-min health check |
116
+ | Tool | Purpose |
117
+ | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
118
+ | `huaweicloud_sandbox_expose_tunnel` | Expose a port → public tunnel URL (auth, pre-clean, health check; `expiry_hours` 1-720, def 72). **AUTO-enrolls into the keepalive watchdog** (`keepalive: false` opts out; the merge preserves the watchdog ROSTER — note each expose pre-cleans all tunnels, so prior tunnels' coverage matters only for hosts surviving outside this flow) |
119
+ | `huaweicloud_sandbox_renew_tunnel` | Renew a tunnel lifetime (`update -e`, rolling window; returns absolute expiresAt) |
120
+ | `huaweicloud_sandbox_keepalive_watchdog` | Install/replace the 3-layer watchdog: host re-attach + daily 720h renewal + 5-min health check |
119
121
 
120
122
  ### Terminal Execution
121
123
 
@@ -187,10 +189,8 @@ Setup is a **plugin-side preflight** — the developer should be asked a questio
187
189
  sleep 1
188
190
  # Remove stale nginx configs from previous deployments
189
191
  sudo rm -f /etc/nginx/conf.d/*.conf /etc/nginx/conf.d/*.conf.bak 2>/dev/null
190
- # Remove stale DevBridge tunnels only (keep other ports/sessions):
191
- # list and delete orphan IDs; the automated connect cleanup does this too.
192
- devbridge list
193
- # devbridge delete <orphan-id>
192
+ # Remove stale DevBridge tunnels
193
+ devbridge delete-all 2>/dev/null || true
194
194
  # Reload nginx to apply
195
195
  sudo nginx -s reload 2>/dev/null || true
196
196
  ```
@@ -279,7 +279,7 @@ hcloud OBS cp <local-file> obs://<bucket>/<key> -f -acl=public-read
279
279
  curl -s -o /workspace/<repo>/<file> https://<bucket>.obs.<region>.myhuaweicloud.com/<key>
280
280
  ```
281
281
 
282
- > Requires OBS credentials (`huaweicloud_setup_obs_config`). Bucket ACL does not cascade to objects — set object-level `-acl=public-read` for anonymous reads.
282
+ > Requires OBS credentials (`huaweicloud_setup_obs_config`, owned by the `obs` pack). If the tool is not registered, `DEVKIT_PACKS` excluded `obs`: have the user configure `~/.obsutilconfig` instead of retrying. Bucket ACL does not cascade to objects — set object-level `-acl=public-read` for anonymous reads.
283
283
 
284
284
  ## Expose the deployed app (public URL)
285
285
 
@@ -315,15 +315,21 @@ curl -fsSL --http1.1 --retry 3 --retry-all-errors --max-time 120 \
315
315
  # Note: GitCode repo is named "devbrige" (missing 'd') — this is the actual repo name, not a typo.
316
316
  # GitHub repo is "devspace-devbridge" (correct spelling). Do NOT "fix" the GitCode URL.
317
317
  DB_TARGET=$(grep -m1 'DEFAULT_VERSION=' /tmp/devbridge-install.sh | cut -d'"' -f2)
318
- if ! bash /tmp/devbridge-install.sh -s -u "https://gitcode.com/CloudDeveloperDepartment/devbrige/releases/download/${DB_TARGET}" -v "${DB_TARGET}"; then
319
- bash /tmp/devbridge-install.sh -s # fallback: GitHub (baked-in URL)
318
+ # -p /workspace/.local/bin (deliberate divergence from main, recorded): the
319
+ # installer's default INSTALL_DIR is ~/.huawei/bin — the SYSTEM disk, wiped on
320
+ # reboot (the exact #999 measured failure). The flag is upstream-supported
321
+ # (install.sh -p, --prefix DIR) and also points the installer's ~/.bashrc PATH
322
+ # line at the data disk.
323
+ if ! bash /tmp/devbridge-install.sh -s -p /workspace/.local/bin -u "https://gitcode.com/CloudDeveloperDepartment/devbrige/releases/download/${DB_TARGET}" -v "${DB_TARGET}"; then
324
+ bash /tmp/devbridge-install.sh -s -p /workspace/.local/bin # fallback: GitHub (baked-in URL)
320
325
  fi
321
326
  export PATH="/workspace/.local/bin:$HOME/.huawei/bin:$PATH" # PREPEND (session shells do not re-source ~/.bashrc)
322
-
323
327
  # Layer 3 (both installer paths failed): direct GitHub release tar.gz.
324
328
  # Asset naming is fixed: devbridge_linux_arm64_<version>-release.tar.gz (the sandbox
325
329
  # is Linux aarch64). If DB_TARGET is empty the installer download itself failed —
326
- # resolve the latest tag from the GitHub releases API first.
330
+ # resolve the latest tag from the GitHub releases API first. The PREPEND above runs
331
+ # FIRST so `command -v` can see a freshly installed binary — otherwise
332
+ # Layer 3 would needlessly re-download after a successful install.
327
333
  # Install to /workspace/.local/bin — /workspace is the sandbox's DATA disk and
328
334
  # survives reboots; ~/.huawei/bin lives on the SYSTEM disk and a reboot wipes it
329
335
  # back to the image state (measured 2026-10-22: an overnight reboot reverted
@@ -350,9 +356,9 @@ devbridge version # must print 0.2.x-release
350
356
  if [ -f /usr/local/bin/devbridge ] && [ -x /workspace/.local/bin/devbridge ] && [ "$(readlink -f /usr/local/bin/devbridge)" != "$(readlink -f /workspace/.local/bin/devbridge)" ]; then
351
357
  rm -f /usr/local/bin/devbridge && echo "stale /usr/local/bin/devbridge removed"
352
358
  fi
353
- # A leftover 0.2.x in ~/.huawei/bin (installed by older docs) is valid until the
354
- # next reboot — deduplicate it against the /workspace copy so the version check
355
- # above can never report the image's 0.1.x.
359
+ # A leftover 0.2.x in ~/.huawei/bin (installed by older docs or an unprefixed
360
+ # installer run) is valid until the next reboot — deduplicate it against the
361
+ # /workspace copy so the version check above can never report the image's 0.1.x.
356
362
  if [ -x "$HOME/.huawei/bin/devbridge" ] && [ -x /workspace/.local/bin/devbridge ] && [ "$(readlink -f "$HOME/.huawei/bin/devbridge")" != "$(readlink -f /workspace/.local/bin/devbridge)" ]; then
357
363
  rm -f "$HOME/.huawei/bin/devbridge" && echo "stale ~/.huawei/bin/devbridge removed"
358
364
  fi
@@ -360,7 +366,7 @@ fi
360
366
 
361
367
  - `-s` (silent) is **required** in the sandbox — without it the installer blocks reading `/dev/tty`.
362
368
  - **Old tunnels do not survive the upgrade**: 0.1.x-created tunnels are not registered on the s2 gateway — always rebuild the tunnel after upgrading (the expose flow below does this via pre-cleanup).
363
- - If `10006: quota exceeded` appears after upgrading, stale pre-upgrade tunnels still count against the quota — the expose tool now removes orphans first, then the oldest non-keepalive tunnel one at a time. Manually: `devbridge list` and `devbridge delete <id>` for stale entries; reserve `devbridge delete-all` for an explicit full reset.
369
+ - If `10006: quota exceeded` appears after upgrading, stale pre-upgrade tunnels still count against the quota — `devbridge delete-all` and retry.
364
370
 
365
371
  ### Sandbox filesystem persistence: what survives a reboot (#999)
366
372
 
@@ -371,7 +377,7 @@ fi
371
377
  | `/usr/local/bin` | System disk | Rolled back — the image-preinstalled 0.1.x returns |
372
378
  | `/tmp` | Session-scoped | Cleared — `/tmp/hw_creds.sh`, `/tmp/hw_api_key`, `/tmp/tunnel-keepalive.sh` are gone |
373
379
 
374
- Measured (2026-10-22): an overnight reboot reverted `~/.huawei/bin/devbridge` 0.2.2 to the image's 0.1.13 — **yesterday's successful operation replayed as today's unexplained failure**. Recovery after a reboot: re-run the Step 0 install (or just re-export the PATH to the surviving `/workspace/.local/bin`), re-run `huaweicloud_sandbox_credentials` to re-inject `/tmp` credentials, and re-run `huaweicloud_sandbox_keepalive_watchdog` to restore the keepalive loop.
380
+ Measured (2026-10-22): an overnight reboot reverted `~/.huawei/bin/devbridge` 0.2.2 to the image's 0.1.13 — **yesterday's successful operation replayed as today's unexplained failure**. Recovery after a reboot: re-run the Step 0 install (or just re-export the PATH to the surviving `/workspace/.local/bin`), and re-run `huaweicloud_sandbox_credentials` to re-inject `/tmp` credentials. The watchdog's tunnel LIST dies with `/tmp` — re-run `huaweicloud_sandbox_keepalive_watchdog` with the full `{tunnel_id, url}` list to restore coverage (a re-expose enrolls only the NEW tunnel it creates).
375
381
 
376
382
  ### Step 1: Authenticate — API Key only (AK/SK removed, auto-create fallback)
377
383
 
@@ -379,7 +385,7 @@ DevBridge authentication is **fixed to API Key** (定稿决策,2026-11-04)。A
379
385
 
380
386
  Authentication tries sources in order, each verified with a real `devbridge auth login --api-key` + `auth status` before use. Note: the probe tests keyring and file in one exec — file hits before auto-create triggers (if a user-provided key exists, it wins over auto-creation):
381
387
 
382
- - **Tier 1 — keyring API Key** (preferred): read via `hwcloud keyring get HW_DEVBRIDGE_API_KEY 2>&1` (⚠ stderr). Sources: (a) self-injected by the plugin's auto-create (devbridge-key.mjs, key names `devkit-ephemeral`/`devkit-persistent` per pool); (b) platform legacy injection (compatible, not relied upon). A light revive (D-Bus restart + keyring unlock) retries once.
388
+ - **Tier 1 — keyring API Key** (preferred): read via `hwcloud keyring get HW_DEVBRIDGE_API_KEY 2>&1` (⚠ stderr). Sources: (a) self-injected by the plugin's auto-create (devbridge-key.ts, key names `devkit-ephemeral`/`devkit-persistent` per pool); (b) platform legacy injection (compatible, not relied upon). A light revive (D-Bus restart + keyring unlock) retries once.
383
389
  - **Tier 2 — `/tmp/hw_api_key` file** (manual channel): written by `huaweicloud_sandbox_credentials` from the local `HW_API_KEY` env or the `api_key` param. If a file exists, it wins over auto-create.
384
390
  - **Tier 3 — auto-create fallback** (host-orchestrated): keyring/file both empty → plugin calls the DevStation relay API (`POST /api-key` via hdkitservice proxy) to create a key → injects into sandbox keyring (file fallback if keyring unavailable) → re-runs probe → reports `API_KEY_AUTO`.
385
391
  - **Self-healing**: key invalid (login fails) → clear cache → recreate → inject → retry probe.
@@ -406,7 +412,7 @@ export DBUS_SESSION_BUS_ADDRESS="${DBUS_SESSION_BUS_ADDRESS:-unix:path=/run/dbus
406
412
  HW_DB_KEY=$(hwcloud keyring get HW_DEVBRIDGE_API_KEY 2>&1 || true)
407
413
  case "$HW_DB_KEY" in
408
414
  devbridge_*) devbridge auth login --api-key "$HW_DB_KEY" ;;
409
- *) # Tier 3: file fallback
415
+ *) # Tier 2: file fallback
410
416
  source /tmp/hw_api_key 2>/dev/null
411
417
  if [ -n "$HW_API_KEY" ]; then devbridge auth login --api-key "$HW_API_KEY"; fi ;;
412
418
  esac
@@ -425,41 +431,41 @@ devbridge auth status
425
431
  Run the web server and the tunnel in the background, then read the URL from the log; the app lives in the workspace mount, e.g. `/workspace/<repo-name>`:
426
432
 
427
433
  ```bash
428
- # 0. Pre-cleanup: replace ONLY the tunnel bound to <port>; keep other ports/sessions.
429
- # (huaweicloud_sandbox_expose_tunnel does this automatically with cleanup_mode=stale.)
430
- OLD_ID=$(devbridge list 2>/dev/null | awk '$2 ~ /^tunnel-<port>-/ {print $1; exit}')
431
- [ -n "$OLD_ID" ] && devbridge delete "$OLD_ID" >/dev/null 2>&1 || true
434
+ # 0. Pre-cleanup: kill old processes and stale tunnels
435
+ pkill -f "devbridge host" 2>/dev/null || true
436
+ sleep 2
437
+ devbridge delete-all 2>/dev/null || true
432
438
 
433
- # 1. Start tunnel
439
+ # 1. Start tunnel (setsid-detached so the host survives the exec session; -e 72 = 72h lifetime)
434
440
  if command -v setsid > /dev/null 2>&1; then setsid nohup devbridge host -p <port> -e 72 > /tmp/host.log 2>&1 < /dev/null & else nohup devbridge host -p <port> -e 72 > /tmp/host.log 2>&1 < /dev/null & fi
435
441
  disown 2>/dev/null || true
436
442
  sleep 10 && cat /tmp/host.log
437
443
 
438
- # 2. Extract tunnel URL and health-check before returning
439
- TUNNEL_URL=$(grep -oP 'Tunnel URL: \K.*' /tmp/host.log)
444
+ # 2. Extract tunnel URL (port-anchored: a multi-port host prints one URL line
445
+ # per port — never a port-blind extraction) and health-check before returning
446
+ TUNNEL_URL=$(grep -oE "https://[A-Za-z0-9_-]+-<port>\.devbridge-s2\.hwtunnel\.com" /tmp/host.log | head -1)
440
447
  # --noproxy is MANDATORY (#1000): the sandbox injects an HTTP proxy that does NOT
441
448
  # route the tunnel domain — without it a working tunnel verifies as 502/404 and
442
449
  # sends you chasing credentials/version/port.
443
- HTTP_CODE=$(curl -s --noproxy '*' -o /dev/null -w "%{http_code}" --max-time 10 "$TUNNEL_URL" 2>/dev/null || echo "000")
450
+ HTTP_CODE=$(curl -s --noproxy '*' -o /dev/null -w "%{http_code}" --max-time 10 "$TUNNEL_URL" 2>/dev/null)
444
451
  if [ "$HTTP_CODE" = "200" ] || [ "$HTTP_CODE" = "304" ]; then
445
452
  echo "Tunnel verified: $TUNNEL_URL (HTTP $HTTP_CODE)"
446
453
  else
447
454
  echo "WARN: Tunnel URL unreachable (HTTP $HTTP_CODE). Rebuilding tunnel..."
448
- # Rebuild only this port's tunnel; never kill/delete other ports or sessions.
449
- OLD_ID=$(devbridge list 2>/dev/null | awk '$2 ~ /^tunnel-<port>-/ {print $1; exit}')
450
- [ -n "$OLD_ID" ] && devbridge delete "$OLD_ID" >/dev/null 2>&1 || true
455
+ pkill -f "devbridge host" && sleep 2
456
+ devbridge delete-all 2>/dev/null || true
451
457
  if command -v setsid > /dev/null 2>&1; then setsid nohup devbridge host -p <port> -e 72 > /tmp/host.log 2>&1 < /dev/null & else nohup devbridge host -p <port> -e 72 > /tmp/host.log 2>&1 < /dev/null & fi
452
458
  disown 2>/dev/null || true
453
459
  sleep 10
454
- TUNNEL_URL=$(grep -oP 'Tunnel URL: \K.*' /tmp/host.log)
455
- HTTP_CODE=$(curl -s --noproxy '*' -o /dev/null -w "%{http_code}" --max-time 10 "$TUNNEL_URL" 2>/dev/null || echo "000")
460
+ TUNNEL_URL=$(grep -oE "https://[A-Za-z0-9_-]+-<port>\.devbridge-s2\.hwtunnel\.com" /tmp/host.log | head -1)
461
+ HTTP_CODE=$(curl -s --noproxy '*' -o /dev/null -w "%{http_code}" --max-time 10 "$TUNNEL_URL" 2>/dev/null)
456
462
  echo "Retry tunnel: $TUNNEL_URL (HTTP $HTTP_CODE)"
457
463
  fi
458
464
  ```
459
465
 
460
466
  **Never return a tunnel URL without verifying it first** — a stale URL (from a killed tunnel process) will silently fail. Always curl-check before giving the URL to the developer. Note: a migrated gateway serves its placeholder page with **HTTP 200** — a bare status check is not enough when diagnosing "200 but wrong content".
461
467
 
462
- **Proxy trap on verify commands (#1000)**: every curl against `*.hwtunnel.com` MUST pass `--noproxy '*'` — the sandbox injects an HTTP/HTTPS proxy that does not route the tunnel domain, so a proxied verify returns 502/404 fakes while the tunnel is actually serving. If a tunnel "fails" verification, re-test with `--noproxy '*'` BEFORE checking versions/credentials/ports (same trap on the SSH path: huawei-ecs skill references/windows-ssh.md §0.1).
468
+ **Proxy trap on verify commands (#1000)**: every curl against `*.hwtunnel.com` MUST pass `--noproxy '*'` — the sandbox injects an HTTP/HTTPS proxy that does not route the tunnel domain, so a proxied verify returns 502/404 fakes while the tunnel is actually serving. If a tunnel "fails" verification, re-test with `--noproxy '*'` BEFORE checking versions/credentials/ports (same trap on the SSH path: huawei-ecs skill references/windows-ssh.md §0.1). localhost curls are unaffected — loopback bypasses the injected proxy.
463
469
 
464
470
  **Quota recovery**: if the tunnel creation fails with `10006: quota exceeded`:
465
471
 
@@ -468,9 +474,8 @@ fi
468
474
  # 0.2.x: `devbridge list` (plain table; data rows start with the 8-char tunnel ID)
469
475
  # 0.1.x (legacy): `devbridge list -j` (JSON)
470
476
  devbridge list
471
- # Step B: Remove stale tunnels one by one (the expose tool already does
472
- # orphans first, then oldest non-keepalive; keep keepalive-protected tunnels)
473
- # devbridge delete <stale-id>
477
+ # Step B: Remove all stale tunnels
478
+ devbridge delete-all
474
479
  # Step C: Retry tunnel creation
475
480
  if command -v setsid > /dev/null 2>&1; then setsid nohup devbridge host -p <port> -e 72 > /tmp/host.log 2>&1 < /dev/null & else nohup devbridge host -p <port> -e 72 > /tmp/host.log 2>&1 < /dev/null & fi
476
481
  disown 2>/dev/null || true
@@ -480,7 +485,7 @@ sleep 10 && cat /tmp/host.log
480
485
  This eliminates the most common deployment failure — historical tunnels from previous sessions accumulating past the max=10 quota.
481
486
 
482
487
  - The public URL has the form `https://<id>-<port>.devbridge-s2.hwtunnel.com` (from the `Tunnel URL:` line; 8-char lowercase base32 id). The pre-migration bridge domain `cn-north-4-bridge.myhuaweicloud.com` is dead — treat any URL on it as broken and never hand one to the developer.
483
- - **Start the host so it survives the exec session**: `setsid nohup ... < /dev/null & disown` (all three: setsid detaches the process group, `< /dev/null` drops the controlling tty, disown removes it from the shell's job table). On images without `setsid`, fall back to a bare `nohup ... &` launch (`if command -v setsid ...; else nohup ... ; fi`) and guard `disown` with `2>/dev/null || true` — a missing `setsid` must not leave the host unstarted. A bare `nohup ... &` (when `setsid` IS available) is reaped when the one-shot session ends — the tunnel dies right after a green in-session health check (the "200 but tunnel not found" trap). If the independent re-verify fails or answers 200 with a "tunnel not found" body, the URL is NOT persistent — always tell the developer 隧道将在会话结束后失效,请勿分享. `-e 72` sets the tunnel lifetime in **hours** — surface it to the developer with the URL ("链接有效期 72 小时").
488
+ - **Start the host so it survives the exec session**: `setsid nohup ... < /dev/null & disown` (all three: setsid detaches the process group, `< /dev/null` drops the controlling tty, disown removes it from the shell's job table). On images without `setsid`, fall back to a bare `nohup ... &` launch (`if command -v setsid ...; else nohup ... ; fi`) and guard `disown` with `2>/dev/null || true` — a missing `setsid` must not leave the host unstarted. A bare `nohup ... &` (when `setsid` IS available) is reaped when the one-shot session ends — the tunnel dies right after a green in-session health check (the "200 but tunnel not found" trap); if an independent re-verify (fresh exec session, GET the URL) fails or answers 200 with a "tunnel not found" body, the URL is NOT persistent — always tell the developer 访问链接将在会话结束后失效,请勿分享 (never say 隧道/DevBridge to the developer — the language rule above). `-e 72` sets the tunnel lifetime in **hours** — surface it to the developer with the URL ("链接已生成,默认自动续期保活" — expiry_hours 默认 72h,keepalive 看门狗每日续到 720h,除非 keepalive:false).
484
489
  - **Return this URL to the developer as the deployment result link.** Keep the host process running (do not close the session before handing over the URL).
485
490
  - Tunnel `description` (`-d`) accepts only Chinese characters, letters, and digits (0-64). Symbols such as `-`/`_`/spaces are rejected (`Invalid tunnel description`).
486
491
  - Official docs: https://huaweicloud.github.io/devspace-devbridge/
@@ -489,15 +494,11 @@ This eliminates the most common deployment failure — historical tunnels from p
489
494
 
490
495
  ### Step 3: Keep the URL alive (persistence & renewal)
491
496
 
492
- **AUTO-ENROLLMENT**: `huaweicloud_sandbox_expose_tunnel` automatically enrolls every exposed tunnel into the keepalive watchdog (merged into existing coverage — exposing a second tunnel never drops the first one's protection; `keepalive: false` opts out). The developer's requirement — "every tunnel deployed to the sandbox must be keepalive-protected" — is satisfied by the tool itself, not by remembering to call the watchdog.
493
-
494
- The tunnel URL is bound to the tunnel ID, not the host process — persistence is about **preventing expiry, never URL recovery**. `-e` accepts 1..720 hours (720 = the 30-day maximum); the expiry is a **rolling window** (renewal sets `expiration = now + hours` regardless of remaining time), so renewing before expiry keeps the same URL alive indefinitely.
497
+ Every tunnel deployed to the sandbox is keepalive-protected by default — `huaweicloud_sandbox_expose_tunnel` AUTO-ENROLLS each exposed tunnel into the watchdog (merged into the existing roster; `keepalive: false` opts out). The enrollment satisfies the developer requirement (unattended renewal + host re-attach + health check) without any manual step.
495
498
 
496
- - **Renew** (same URL, extends lifetime): `huaweicloud_sandbox_renew_tunnel` (or `devbridge update <id> -e 720`). A renewal counts as ok only when the update succeeds AND `show <id> -v` reports the absolute `tunnelExpiration` — the management plane can lose a tunnel record (`10002 tunnel not found`) while the data plane keeps serving.
497
- - **Host process dies** → the watchdog re-attaches with `devbridge host <id>`; the URL does NOT change.
498
- - **Manual install / replacement / repair** → `huaweicloud_sandbox_keepalive_watchdog`: installs a setsid-detached loop (host watchdog + daily 720h renewal + 5-min health check) at `/tmp/tunnel-keepalive.sh`.
499
-
500
- Complete measured procedure and traps (OSC-escape port list, health-check URL, watchdog pgrep): see `references/tunnel-persistence.md`.
499
+ - **Tunnel lifetime is a rolling window** — renew before expiry and the SAME URL stays alive indefinitely (`huaweicloud_sandbox_renew_tunnel`, or the watchdog's daily 720h renewal).
500
+ - **Host dies (sandbox restart / session teardown)** — the watchdog re-attaches with `devbridge host <id>`; the URL is bound to the tunnel ID and never changes.
501
+ - **Manual install / full-list replacement** — `huaweicloud_sandbox_keepalive_watchdog` with the `{tunnel_id, url}` list (it SETS the list; expose MERGES into it). Full doctrine: `references/tunnel-persistence.md`.
501
502
 
502
503
  ## Full-Stack: REST API over PostgreSQL (PostgREST)
503
504
 
@@ -506,15 +507,15 @@ When deploying a **full-stack workbench project** (前后端工作台) or asking
506
507
  1. **PostgreSQL 16 from PGDG** — the OS repo only ships PG 13, and PostgREST 16.x requires PG ≥ 14. HCE is NOT el8-lib-compatible: hand-write the repo file (the el8 path is `rhel-8-aarch64` WITH a hyphen), install the RPMs one-per-call with `--nodeps`, and shim the sonames — including the REAL `libicu-60` package (ICU symlinks load but crash on versioned symbols).
507
508
  2. **PostgREST `linux-static-aarch64`** — dynamic Ubuntu builds fail on HCE glibc. Create the schema and a read-only `api_user` role (the anon role gates all writes; POST/PATCH → 401).
508
509
  3. **Nginx single-origin** — `/` serves the frontend, `/api/` reverse-proxies to PostgREST (no CORS, same origin). The frontend dir needs `chmod o+x` on the whole path chain or nginx returns 403.
509
- 4. **Expose + keep alive (automatic)** — `huaweicloud_sandbox_expose_tunnel` with the nginx port; it AUTO-enrolls the tunnel into the keepalive watchdog (merged into existing coverage). Prefer `expiry_hours: 720` for long-lived workbench deployments.
510
+ 4. **Expose + keep alive (automatic)** — `huaweicloud_sandbox_expose_tunnel` with the nginx port; it AUTO-enrolls the tunnel into the keepalive watchdog. Prefer `expiry_hours: 720` for long-lived workbench deployments.
510
511
 
511
- Complete measured procedure (full command chain) plus the 2026-10 field notes (Aliyun mirror URLs, cross-mirror resume corruption, `upload_file` 640 → PGRST002, exec-channel escaping → upload files and run `psql -f` / `curl -d @file`): see `references/fullstack-postgrest.md`. For the sandbox restart recovery checklist (what survives on `/workspace` vs what is lost on the 系统盘, plus the write-GRANT rollback trap): see the `Sandbox Restart Recovery Checklist` section in the same file.
512
+ Complete measured procedure (with the full command chain): see `references/fullstack-postgrest.md`.
512
513
 
513
514
  ## Web Application Deployment
514
515
 
515
516
  When deploying a web application to the sandbox, build the app inside the sandbox before exposing it. Source code is uploaded, dependencies installed, and the framework built in the sandbox environment.
516
517
 
517
- **Backend selection (Stack-Selection Gate)**: the backend choice was already confirmed by the [Stack-Selection Gate](#stack-selection-gate-mandatory--do-not-skip) before any code was uploaded. If the project includes a PostgreSQL + PostgREST backend (or the developer asked for one), set up the backend FIRST by following [Full-Stack: REST API over PostgreSQL](#full-stack-rest-api-over-postgresql-postgrest) — install PostgreSQL/PostgREST, create the schema, and point the frontend's nginx `/api/` location at PostgREST — then continue with the steps below. Every tunnel exposed afterwards is auto-enrolled into the keepalive watchdog.
518
+ **Backend present?** The backend choice was already confirmed by the [Stack-Selection Gate](#stack-selection-gate-mandatory--do-not-skip) before any code was uploaded. If the project includes a PostgreSQL + PostgREST backend (or the developer asks for one), set up the backend FIRST by following [Full-Stack: REST API over PostgreSQL](#full-stack-rest-api-over-postgresql-postgrest) — install PostgreSQL/PostgREST, create the schema, and point the frontend's nginx `/api/` location at PostgREST — then continue with the steps below (the Full-Stack section's single-origin nginx config already serves `/` and `/api/` — skip the Configure Nginx sub-step, whose SPA/proxy/static templates carry no `/api/` reverse proxy and would displace it). Every tunnel exposed afterwards is auto-enrolled into the keepalive watchdog.
518
519
 
519
520
  **沙箱无 systemd(实测 #935 报告3 问题3)**:沙箱为无 systemd 的容器环境,`systemctl` 全部失效(`System has not been booted with systemd`)—— 不要用 `systemctl start/reload/restart nginx`。Nginx 配置变更直接使用 `nginx -t` 验证 + `nginx -s reload` 热加载,或直接执行 nginx 二进制(`sudo nginx` 启动 / `nginx -s stop` 停止)。`huaweicloud_sandbox_deploy_nginx` 工具返回的 nextStep 文案与该语义一致(配置写入后自动回验存在性与 `nginx -t`,通过后即生效,无需 systemctl)。
520
521
 
@@ -532,6 +533,8 @@ When deploying a web application to the sandbox, build the app inside the sandbo
532
533
 
533
534
  If detection returns `null`, the project is not a recognized web app. Stop and tell the developer.
534
535
 
536
+ > `huaweicloud_detect_framework` is owned by the `discovery` pack. If the tool is not registered, the server was started with `DEVKIT_PACKS` excluding `discovery`: ask the developer for the framework, build command, and output directory, then proceed. Retrying the call cannot help.
537
+
535
538
  If detection returns `type: "monorepo"`, show the `subApps` list to the developer and ask which sub-app to deploy. Then re-detect that sub-app's framework.
536
539
 
537
540
  ### Step 2: Connect and Upload
@@ -1000,17 +1003,17 @@ If the status code is not 2xx/3xx:
1000
1003
 
1001
1004
  ### Step 7: Expose via DevBridge [REQUIRED — deployment incomplete without this]
1002
1005
 
1003
- **Preferred: call `huaweicloud_sandbox_expose_tunnel` with the ACTUAL port returned by `deploy_nginx` (`{"port": <port>}`)** — it authenticates automatically (probing AK/SK vs API-Key builds), pre-cleans stale tunnels, starts the host, extracts the public URL, and health-checks it before returning. If it reports `ok: false` with an API-Key hint, create the key and re-run `sandbox_credentials`, then call it again. The tool's returned `publicUrl` is the deployment result.
1006
+ **Preferred: call `huaweicloud_sandbox_expose_tunnel` with the ACTUAL port returned by `deploy_nginx` (`{"port": <port>}`)** — it authenticates automatically through the credential waterfall (keyring → API-Key file → auto-created API Key), pre-cleans stale tunnels, starts the host, extracts the public URL, and health-checks it before returning. If it reports `ok: false` with an API-Key hint, create the key and re-run `sandbox_credentials`, then call it again. The tool's returned `publicUrl` is the deployment result; an `ok: false` verdict (including a migrated-placeholder URL) means the deployment is NOT complete — never fabricate or reuse a dead URL.
1004
1007
 
1005
- **Manual fallback** (only when the tool is unavailable or must be debugged by hand): follow [Expose the deployed app](#expose-the-deployed-app-public-url) below.
1008
+ **Manual fallback** (only when the tool is unavailable or must be debugged by hand): follow the rest of this section.
1006
1009
 
1007
- When `deploy_check` returns `nextStep: expose_via_devbridge`, it also returns an executable `remediation` string — run those devbridge commands in the sandbox (after `source /tmp/hw_creds.sh`). Until a tunnel exists, `deploy_check` returns no `publicUrl`; do not fabricate a URL.
1010
+ When `deploy_check` returns `nextStep: expose_via_devbridge`, it also returns an executable `remediation` string — run those devbridge commands in the sandbox (the file channel sources `/tmp/hw_api_key` when present — the STS AK/SK file is not part of the devbridge chain). Until a tunnel exists, `deploy_check` returns no `publicUrl`; do not fabricate a URL.
1008
1011
 
1009
1012
  Follow the standard [Expose the deployed app](#expose-the-deployed-app-public-url) procedure. The app is already running on the detected port — only DevBridge tunnel setup is needed.
1010
1013
 
1011
- Use `exec_with_session` to background DevBridge. For SSR, DevBridge tunnels the nginx public port (not the Node port directly).
1014
+ Use `exec_with_session` for the Expose steps, and copy the guarded `setsid nohup … < /dev/null & disown` launch verbatim — the guard (not the exec flavor) is what makes the host survive the session. For SSR, DevBridge tunnels the nginx public port (not the Node port directly).
1012
1015
 
1013
- **Pre-flight**: `huaweicloud_sandbox_expose_tunnel` now performs **selective cleanup** automatically (default `cleanup_mode=stale`): it removes orphan records/hosts and replaces the tunnel bound to the requested port; all other ports, other sessions and keepalive-protected tunnels are preserved (the same-port tunnel is the one documented exception — a port cannot have two tunnels). On `10006: quota exceeded` it removes all orphans first, then the oldest non-keepalive tunnel one at a time; keepalive-protected tunnels are never auto-deleted and a still-full quota returns `devbridge_tunnel_quota_exceeded`. `cleanup_mode=none` skips cleanup entirely (a stale same-port host can then conflict). For manual flows, prefer `devbridge list` + `devbridge delete <id>` for stale entries; use `devbridge delete-all` only for an explicit full reset (shared-sandbox warning below).
1016
+ **Pre-flight**: always run `devbridge delete-all` before creating a new tunnel to prevent `10006: quota exceeded` from accumulated stale tunnels. If you still get quota error, list tunnels with `devbridge list` (0.2.x plain table; 0.1.x legacy `-j` JSON), delete stale ones, and retry.
1014
1017
 
1015
1018
  > **Concurrency warning**: `devbridge delete-all` and `pkill -f "devbridge host"` are GLOBAL operations scoped to the whole sandbox — if multiple sessions share the same sandbox, pre-cleaning can kill tunnels published by other sessions and invalidate URLs you handed out earlier. For shared sandboxes, prefer `devbridge list` and delete only stale/your-own tunnels instead of blanket `delete-all`, and re-expose only after confirming the target port is still served.
1016
1019
 
@@ -1054,10 +1057,10 @@ echo "Desktop URL: $TUNNEL_URL"
1054
1057
 
1055
1058
  The tool checks:
1056
1059
 
1057
- - **nginx_serving** — nginx responds with 2xx/3xx on the app port
1060
+ - **nginx_serving** — nginx answers on the app port with ANY non-000 HTTP code (404/502 = content issue, not a connectivity issue)
1058
1061
  - **output_dir** — build output directory exists and is non-empty
1059
1062
  - **devbridge_tunnel** — DevBridge tunnel is active (version-aware: 0.1.x JSON / 0.2.x table)
1060
- - **tunnel_url_accessible** — tunnel URL returns 200/304 with real content; these all count as FAIL: a gateway migration placeholder page (「服务已迁移」 with HTTP 200), `tunnel not found` (404 — no live host session on the gateway, even if the tunnel still appears in `devbridge list`), `port not configured` (404 — URL port not registered on the tunnel), and `bad gateway` (502 — tunnel alive but the local service is down). The check probes every listed tunnel and selects one that actually serves the port.
1063
+ - **tunnel_url_accessible** — the probed tunnel URL (constructed on the current s2 gateway domain, one probe per listed tunnel, bounded to 5) answers with any non-000 code EXCEPT the gateway-level dead forms, matched by exact body + status: `tunnel not found` (404 — no live host session on the gateway, even if the tunnel still appears in `devbridge list`), `port not configured` (404 — URL port not registered on the tunnel), and `bad gateway` (502 — tunnel alive but the local service is down). A retired pre-migration gateway placeholder is an `expose_tunnel` verdict (host-log marker), not this probe's concern.
1061
1064
  - **qr_code** (cross-platform only) — QR image exists in output dir
1062
1065
 
1063
1066
  Returns `complete: true/false`, `score`, and `nextStep` to fix missing items.
@@ -1078,40 +1081,44 @@ Returns `complete: true/false`, `score`, and `nextStep` to fix missing items.
1078
1081
  - [Framework Commands](references/framework-commands.md) — command mapping for all supported frameworks
1079
1082
  - [Nginx Templates](references/nginx-templates.md) — nginx configuration templates and fallback
1080
1083
  - [Resource Pool](references/resource-pool.md) — 资源池定稿口径:两沙箱类型、申请/限流参数(持久 2U4G×300 + 4U8G×200、非持久 2U4G×1000、overlayer 5GB/实例、EVS 300TB)、配额 1/类型 与 429+Retry-After 语义
1084
+ - [Tunnel persistence](references/tunnel-persistence.md) — renewal, re-attach, and the keepalive watchdog
1085
+ - [Full-stack PostgREST](references/fullstack-postgrest.md) — the measured PostgreSQL 16 + PostgREST + nginx procedure
1081
1086
 
1082
1087
  ## Critical Warnings
1083
1088
 
1084
- | Trap | Why |
1085
- | -------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1086
- | Target not confirmed | "部署到华为云" without a named target is NOT a go signal. You MUST run the Target-Selection Gate and get an explicit choice before calling any sandbox lifecycle tool. Skipping it and defaulting to the sandbox is a violation. |
1087
- | Agreement required first | `sandbox_connect` fails if the agreement isn't signed; the `sandbox_check_user` preflight detects this, so surface it to the developer only when signing is needed |
1088
- | Real-name required | `sandbox_connect` fails if `realnameVerified=false`; tell the developer once and stop, don't loop on connect |
1089
- | Never expose tunnel details | Do not mention "DevBridge"/"tunnel"/"devbridge" to the developer — say "正在生成访问地址..." and hand over only the URL |
1090
- | devbridge auth: API Key only | DevBridge auth is fixed to API Key (AK/SK login removed, 2026-11-04). The waterfall: keyring (ours + platform legacy) → auto-create fallback → file. Use `devbridge auth login --api-key` only — never `--access-key/--secret-key`. |
1091
- | devbridge 0.1.x is dead | Sandboxes created before Sep 2026 ship 0.1.13, which connects to a migrated gateway serving a 「服务已迁移」 placeholder with HTTP 200. Check `devbridge version` first and upgrade in place (Step 0) — old tunnels never survive the upgrade |
1092
- | CLI PATH | The installer only writes `~/.bashrc`; run `export PATH="/workspace/.local/bin:$HOME/.huawei/bin:$PATH"` (prepend) in the session before using `devbridge` — appending lets a stale image binary in `/usr/local/bin` win. `/workspace/.local/bin` survives sandbox reboots; `~/.huawei/bin` is on the system disk and is wiped on reboot (#999) |
1093
- | Never install tunnel tooling locally | If the sandbox cannot install it, report a generic error and stop — installing on the developer's machine defeats sandbox deployment |
1094
- | Return the deployment URL | Always hand the public URL from the host log to the developer as the final result |
1095
- | Deploy is not just nginx | Configuring nginx does NOT complete the deployment. Steps 7 (DevBridge expose) and deploy_check are REQUIRED — `deploy_nginx` returns `nextStep: expose_via_devbridge` as a reminder. Do not stop after nginx. |
1096
- | Call deploy_check before success | Always call `huaweicloud_sandbox_deploy_check` before reporting deployment success. A green nginx status does not mean the tunnel is accessible — verify end-to-end with the tool. |
1097
- | Session state persists | `exec_with_session` preserves `cd`, env vars, aliases between calls |
1098
- | Long commands prefer one-shot | `exec_one_shot` creates a fresh connection per call — more stable for builds, installs, and scripts >30s. See [Tool Selection Guide](#tool-selection-guide). |
1099
- | SSR nginx/Node ports must differ | nginx `proxy_pass` targets `<nodePort>`, not `<port>`. `deploy_nginx` auto-defaults `nodePort` to `<port>+1` — always start the Node process with `PORT=<nodePort>` to match. Same-port = EADDRINUSE. |
1100
- | HTTP 200 ≠ correct content | A green HTTP check does not guarantee the right project is serving — old processes from a previous session bound to the same port will still return 200. `deploy_check` verifies the deployment fingerprint to catch this. |
1101
- | Destructive commands blocked | `rm -rf /`, `mkfs`, `dd if=`, fork bombs are denied by safety policy |
1102
- | Workspace ID = dev_stage_id | Use `dev_stage_id` from `sandbox_connect` as `workspace_id` for terminal exec |
1103
- | Projects live in `/workspace` | Clone/install project code under `/workspace/<repo-name>` (filesystem-root workspace mount, not `$HOME/workspace`), never in `/tmp` — ephemeral locations lose the project when the sandbox session restarts |
1104
- | Upload project for local code | Use `sandbox_upload_project` to transfer local projects — packages as tar.gz, uploads via HTTP tunnel, extracts on sandbox. Much faster than base64 for multi-file projects |
1105
- | Upload file for single files | Use `sandbox_upload_file` for individual files — base64 chunked, reliable for small files (<1MB) |
1106
- | Node.js >= 22 required | Sandbox terminal uses built-in WebSocket (globalThis.WebSocket); if Node.js is missing, install it from the Huawei Cloud mirror (see "Node.js in the sandbox") |
1107
- | Sandbox restart kills processes | After sandbox restarts, all user processes (nginx, Node.js, Python servers) are stopped. Re-run startup commands and verify ports are listening before proceeding. |
1108
- | Cross-platform binaries incompatible | The sandbox runs Linux. Native binaries built on Windows/macOS (e.g., Prisma client, `node_modules/.prisma/`, platform-specific native addons) will not execute. Always install and build dependencies inside the sandbox, not locally. |
1109
- | Cross-platform needs QR code | When `detect_framework` returns `type: "cross-platform"` (Taro, uni-app), generating a QR code image is **mandatory** — the deployment is incomplete without it. Check the Deployment Completion Check table in Step 7. |
1110
- | Build fails do NOT auto-fix | When a build exits with non-zero exit code, STOP and present the error + fix options to the developer. Do not silently retry, modify configs, or change source files without explicit approval. See 4c-aux. |
1111
- | Tunnel description: no spaces/hyphens | `devbridge create <name> -d 'hello world'` fails with `Invalid tunnel description: only Chinese characters, digits, letters, length 0-64`. The message is misleading — the real rule is no spaces/hyphens. Omit `-d` or use bare letters/digits. |
1112
- | Use `host`, never `connect` | `devbridge connect` is the sender side (for on-prem machines dialing out). For public preview it loops `Connection failed, retrying...` forever with no hint. Always use `devbridge host <tunnelId> -p <port>`. |
1113
- | Port drift detaches the tunnel | When deploy_nginx auto-increments to a free port, an existing tunnel stays bound to the old port — re-bind: `devbridge port create <tunnelId> -p <newPort> --protocol http -a` and restart `devbridge host`. deploy_nginx emits a warning when this happens. |
1114
- | 404 "tunnel not found" ≠ content issue | The s2 gateway answers 404 with body `tunnel not found` when the host process is dead (the tunnel record may STILL show in `devbridge list`) and `port not configured` for an unregistered URL port — both mean the URL is dead, not that the app returned 404. `expose_tunnel`/`deploy_check` verify the probe body and refuse such URLs; a shared sandbox's second deployment also kills earlier URLs (global pre-clean), so re-expose and hand over the fresh URL. |
1089
+ | Trap | Why |
1090
+ | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1091
+ | Target not confirmed | "部署到华为云" without a named target is NOT a go signal. You MUST run the Target-Selection Gate and get an explicit choice before calling any sandbox lifecycle tool. Skipping it and defaulting to the sandbox is a violation. |
1092
+ | Stack not confirmed (workbench ⇒ SPA) | 工作台/全栈/full-stack/CRUD/数据库/持久化 requests are full-stack workbench deployments (PostgreSQL + PostgREST default) even when no database is mentioned. NEVER infer or default the stack to SPA — run the Stack-Selection Gate (Step 0.5) before uploading or writing ANY application code; an SPA-only deployment that already started with persistence implied must be STOPped and redirected to the full-stack path, not papered over with a bolted-on static backend. |
1093
+ | Pool type fixes durability | 预览/试用/即焚 requests belong on the `ephemeral` pool — idle 30min auto-shutdown + 1h auto-delete (平台定时任务,已实测), nothing survives it, data dies with the box; 工作台/带数据库/跨日 requests belong on the `persistent` pool (EVS 32G mounted, survives reboots, idle reclaim within 7 days max). Pick per the 两池沙箱(pool_type) selection rules (Step 0.3) BEFORE calling `sandbox_connect`, and never promise durability on an ephemeral sandbox. A rejected connect returns HTTP 429 with a Retry-After header and a dual error code — the CODE, not the status, separates the two failure classes: HDKIT_QUOTA_EXCEEDED (quota — 1 instance per pool type; release or reuse, retry useless) vs HDKIT_CAPACITY_INSUFFICIENT (pool capacity; retry later / off-peak). |
1094
+ | Agreement required first | `sandbox_connect` fails if the agreement isn't signed; the `sandbox_check_user` preflight detects this, so surface it to the developer only when signing is needed |
1095
+ | Real-name required | `sandbox_connect` fails if `realnameVerified=false`; tell the developer once and stop, don't loop on connect |
1096
+ | Never expose tunnel details | Do not mention "DevBridge"/"tunnel"/"devbridge" to the developer — say "正在生成访问地址..." and hand over only the URL |
1097
+ | devbridge auth: API Key only | DevBridge auth is fixed to API Key (AK/SK login removed, 2026-11-04). The waterfall: keyring (ours + platform legacy) → file → auto-create fallback. Use `devbridge auth login --api-key` only — never `--access-key/--secret-key`. |
1098
+ | devbridge 0.1.x is dead | Sandboxes created before Sep 2026 ship 0.1.13, which connects to a migrated gateway serving a 「服务已迁移」 placeholder with HTTP 200. Check `devbridge version` first and upgrade in place (Step 0) — old tunnels never survive the upgrade |
1099
+ | CLI PATH | The installer only writes `~/.bashrc`; run `export PATH="/workspace/.local/bin:$HOME/.huawei/bin:$PATH"` (prepend, data-disk first) in the session before using `devbridge` — appending lets a stale image binary in `/usr/local/bin` win, and `~/.huawei/bin` alone is wiped on reboot (#999) |
1100
+ | Never install tunnel tooling locally | If the sandbox cannot install it, report a generic error and stop — installing on the developer's machine defeats sandbox deployment |
1101
+ | Return the deployment URL | Always hand the public URL from the host log to the developer as the final result |
1102
+ | Deploy is not just nginx | Configuring nginx does NOT complete the deployment. Steps 7 (DevBridge expose) and deploy_check are REQUIRED — `deploy_nginx` returns `nextStep: expose_via_devbridge` as a reminder. Do not stop after nginx. |
1103
+ | Call deploy_check before success | Always call `huaweicloud_sandbox_deploy_check` before reporting deployment success. A green nginx status does not mean the tunnel is accessible — verify end-to-end with the tool. |
1104
+ | Session state persists | `exec_with_session` preserves `cd`, env vars, aliases between calls |
1105
+ | Long commands prefer one-shot | `exec_one_shot` creates a fresh connection per call — more stable for builds, installs, and scripts >30s. See [Tool Selection Guide](#tool-selection-guide). |
1106
+ | SSR nginx/Node ports must differ | nginx `proxy_pass` targets `<nodePort>`, not `<port>`. `deploy_nginx` auto-defaults `nodePort` to `<port>+1` — always start the Node process with `PORT=<nodePort>` to match. Same-port = EADDRINUSE. |
1107
+ | HTTP 200 ≠ correct content | A green HTTP check does not guarantee the right project is serving — old processes from a previous session bound to the same port will still return 200. `deploy_check` verifies the deployment fingerprint to catch this. |
1108
+ | 404 "tunnel not found" ≠ content issue | The s2 gateway answers 404 with body `tunnel not found` when the host process is dead (the tunnel record may STILL show in `devbridge list`) and `port not configured` for an unregistered URL port — both mean the URL is dead, not that the app returned 404. `expose_tunnel`/`deploy_check` verify the probe body and refuse such URLs; a shared sandbox's second deployment also kills earlier URLs (global pre-clean), so re-expose and hand over the fresh URL. |
1109
+ | Destructive commands blocked | `rm -rf /`, `mkfs`, `dd if=`, fork bombs are denied by safety policy |
1110
+ | Workspace ID = dev_stage_id | Use `dev_stage_id` from `sandbox_connect` as `workspace_id` for terminal exec |
1111
+ | Projects live in `/workspace` | Clone/install project code under `/workspace/<repo-name>` (filesystem-root workspace mount, not `$HOME/workspace`), never in `/tmp` — ephemeral locations lose the project when the sandbox session restarts |
1112
+ | Upload project for local code | Use `sandbox_upload_project` to transfer local projects — packages as tar.gz, uploads via HTTP tunnel, extracts on sandbox. Much faster than base64 for multi-file projects |
1113
+ | Upload file for single files | Use `sandbox_upload_file` for individual files — base64 chunked, reliable for small files (<1MB) |
1114
+ | Node.js >= 22 required | Sandbox terminal uses built-in WebSocket (globalThis.WebSocket); if Node.js is missing, install it from the Huawei Cloud mirror (see "Node.js in the sandbox") |
1115
+ | Sandbox restart kills processes | After sandbox restarts, all user processes (nginx, Node.js, Python servers) are stopped. Re-run startup commands and verify ports are listening before proceeding. |
1116
+ | Cross-platform binaries incompatible | The sandbox runs Linux. Native binaries built on Windows/macOS (e.g., Prisma client, `node_modules/.prisma/`, platform-specific native addons) will not execute. Always install and build dependencies inside the sandbox, not locally. |
1117
+ | Cross-platform needs QR code | When `detect_framework` returns `type: "cross-platform"` (Taro, uni-app), generating a QR code image is **mandatory** — the deployment is incomplete without it. Check the Deployment Completion Check table in Step 7. |
1118
+ | Build fails do NOT auto-fix | When a build exits with non-zero exit code, STOP and present the error + fix options to the developer. Do not silently retry, modify configs, or change source files without explicit approval. See 4c-aux. |
1119
+ | Tunnel description: no spaces/hyphens | `devbridge create <name> -d 'hello world'` fails with `Invalid tunnel description: only Chinese characters, digits, letters, length 0-64`. The message is misleading — the real rule is no spaces/hyphens. Omit `-d` or use bare letters/digits. |
1120
+ | Use `host`, never `connect` | `devbridge connect` is the sender side (for on-prem machines dialing out). For public preview it loops `Connection failed, retrying...` forever with no hint. Always use `devbridge host <tunnelId> -p <port>`. |
1121
+ | Port drift detaches the tunnel | When deploy_nginx auto-increments to a free port, an existing tunnel stays bound to the old port — re-bind: `devbridge port create <tunnelId> -p <newPort> --protocol http -a` and restart `devbridge host`. deploy_nginx emits a warning when this happens. |
1115
1122
 
1116
1123
  ## Node.js in the sandbox
1117
1124
 
@@ -1,3 +1,5 @@
1
+ <!-- generated from src/packs/sandbox/skills/huawei-sandbox - do not edit -->
2
+
1
3
  # Framework Command Mapping
2
4
 
3
5
  Maps web frameworks to install, build, serve commands and output directories for sandbox deployment.