huaweicloud-devkit 1.1.13 → 2.0.0-next.0
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.
- package/README.md +16 -5
- package/README.zh-CN.md +16 -5
- package/bin/dsh-postinstall.cjs +171 -31
- package/bin/setup.cjs +1 -1
- package/cordis.patch.yml +1 -1
- package/integrations/atomcode/hooks/huaweicloud-telemetry.js +29 -33
- package/integrations/dsh/hook-plugin.d.mts +19 -0
- package/integrations/dsh/hook-plugin.mjs +23 -22
- package/integrations/hermes/hooks/huaweicloud-telemetry.py +26 -43
- package/integrations/hermes/manifest.yaml +35 -10
- package/integrations/opencode/commands/huaweicloud-doctor.md +3 -2
- package/integrations/opencode/hooks/skill-tracker.js +70 -89
- package/integrations/opencode/opencode.json +5 -6
- package/integrations/workbuddy/hooks/telemetry-tracker.py +27 -45
- package/package.json +32 -11
- package/plugins/huaweicloud-core/.claude-plugin/plugin.json +1 -2
- package/plugins/huaweicloud-core/.codex-plugin/plugin.json +1 -2
- package/plugins/huaweicloud-core/.cursor-plugin/plugin.json +1 -2
- package/plugins/huaweicloud-core/.hermes-plugin/plugin.json +1 -2
- package/plugins/huaweicloud-core/.mcp.json +1 -1
- package/plugins/huaweicloud-core/.workbuddy-plugin/plugin.json +1 -2
- package/plugins/huaweicloud-core/dist/agents/atomcode.js +118 -0
- package/plugins/huaweicloud-core/dist/agents/codearts-work.js +121 -0
- package/plugins/huaweicloud-core/dist/agents/codearts.js +69 -0
- package/plugins/huaweicloud-core/dist/agents/codex-desktop.js +193 -0
- package/plugins/huaweicloud-core/dist/agents/codex.js +205 -0
- package/plugins/huaweicloud-core/dist/agents/dsh-patch.js +172 -0
- package/plugins/huaweicloud-core/dist/agents/dsh.js +129 -0
- package/plugins/huaweicloud-core/dist/agents/hermes-config.js +976 -0
- package/plugins/huaweicloud-core/dist/agents/hermes-hook-plugin.js +90 -0
- package/plugins/huaweicloud-core/dist/agents/hermes-hooks.js +166 -0
- package/plugins/huaweicloud-core/dist/agents/hermes-sdk.js +58 -0
- package/plugins/huaweicloud-core/dist/agents/hermes.js +150 -0
- package/plugins/huaweicloud-core/dist/agents/officeace-registry.js +179 -0
- package/plugins/huaweicloud-core/dist/agents/officeace-sqlite.js +132 -0
- package/plugins/huaweicloud-core/dist/agents/officeace.js +173 -0
- package/plugins/huaweicloud-core/dist/agents/openclaw.js +54 -0
- package/plugins/huaweicloud-core/dist/agents/opencode-config.js +188 -0
- package/plugins/huaweicloud-core/dist/agents/opencode.js +112 -0
- package/plugins/huaweicloud-core/dist/agents/workbuddy.js +194 -0
- package/plugins/huaweicloud-core/dist/auth/account-type.js +136 -0
- package/plugins/huaweicloud-core/dist/auth/agent-registration.js +243 -0
- package/plugins/huaweicloud-core/dist/auth/cli.js +114 -0
- package/plugins/huaweicloud-core/dist/auth/codearts-context.js +131 -0
- package/plugins/huaweicloud-core/dist/auth/credential-placeholder.js +41 -0
- package/plugins/huaweicloud-core/dist/auth/credential-resolver.js +74 -0
- package/plugins/huaweicloud-core/dist/auth/credential-validator.js +139 -0
- package/plugins/huaweicloud-core/dist/auth/credentials.js +20 -0
- package/plugins/huaweicloud-core/dist/auth/error-table.js +123 -0
- package/plugins/huaweicloud-core/dist/auth/hcloud-profile.js +89 -0
- package/plugins/huaweicloud-core/dist/auth/init-cli.js +139 -0
- package/plugins/huaweicloud-core/dist/auth/missing-credential-error.js +33 -0
- package/plugins/huaweicloud-core/dist/auth/obs-config.js +31 -0
- package/plugins/huaweicloud-core/dist/auth/project-id.js +90 -0
- package/plugins/huaweicloud-core/dist/auth/reconcile.js +256 -0
- package/plugins/huaweicloud-core/dist/auth/runtime-credentials.js +32 -0
- package/plugins/huaweicloud-core/dist/auth/s1-store.js +171 -0
- package/plugins/huaweicloud-core/dist/auth/service.js +397 -0
- package/plugins/huaweicloud-core/dist/auth/sts-expiry.js +58 -0
- package/plugins/huaweicloud-core/dist/capability-catalog.js +494 -0
- package/plugins/huaweicloud-core/dist/codearts-sandbox.js +32 -0
- package/plugins/huaweicloud-core/dist/codex-probe.js +77 -0
- package/plugins/huaweicloud-core/dist/data/icons-manifest.v1.json +3517 -0
- package/plugins/huaweicloud-core/dist/dep/installers/gateway.js +186 -0
- package/plugins/huaweicloud-core/dist/dep/installers/hcloud.js +370 -0
- package/plugins/huaweicloud-core/dist/dep/installers/table.js +28 -0
- package/plugins/huaweicloud-core/dist/dep/provision.js +247 -0
- package/plugins/huaweicloud-core/dist/dep/receipts.js +385 -0
- package/plugins/huaweicloud-core/dist/detect-framework-match.js +111 -0
- package/plugins/huaweicloud-core/dist/detect-framework-pkg.js +85 -0
- package/plugins/huaweicloud-core/dist/detect-framework-scan.js +93 -0
- package/plugins/huaweicloud-core/dist/detect-framework-table.js +153 -0
- package/plugins/huaweicloud-core/dist/detect-framework.js +7 -0
- package/plugins/huaweicloud-core/dist/doctor-native.js +167 -0
- package/plugins/huaweicloud-core/dist/doctor-payload.js +34 -0
- package/plugins/huaweicloud-core/dist/doctor-report.js +8 -0
- package/plugins/huaweicloud-core/dist/explain-error.js +209 -0
- package/plugins/huaweicloud-core/dist/hcloud-api-error.js +64 -0
- package/plugins/huaweicloud-core/dist/hcloud-catalog.js +91 -0
- package/plugins/huaweicloud-core/dist/hcloud-cli.js +24 -0
- package/plugins/huaweicloud-core/dist/hcloud-obs-redact.js +68 -0
- package/plugins/huaweicloud-core/dist/hcloud-plan.js +298 -0
- package/plugins/huaweicloud-core/dist/hcloud-probe.js +153 -0
- package/plugins/huaweicloud-core/dist/hcloud-run-once.js +245 -0
- package/plugins/huaweicloud-core/dist/hcloud-run.js +107 -0
- package/plugins/huaweicloud-core/dist/hcloud-sg-preflight.js +104 -0
- package/plugins/huaweicloud-core/dist/hcloud-sts.js +113 -0
- package/plugins/huaweicloud-core/dist/hcloud-triage.js +71 -0
- package/plugins/huaweicloud-core/dist/icon-library.js +216 -0
- package/plugins/huaweicloud-core/dist/install-payload.js +35 -0
- package/plugins/huaweicloud-core/dist/install-plan.js +85 -0
- package/plugins/huaweicloud-core/dist/install-prompts.js +119 -0
- package/plugins/huaweicloud-core/dist/koocli-version.js +83 -0
- package/plugins/huaweicloud-core/dist/lib/approval-tokens.js +234 -0
- package/plugins/huaweicloud-core/dist/lib/as-record.js +10 -0
- package/plugins/huaweicloud-core/dist/lib/as-text.js +15 -0
- package/plugins/huaweicloud-core/dist/lib/banner.js +10 -0
- package/plugins/huaweicloud-core/dist/lib/call-trace.js +128 -0
- package/plugins/huaweicloud-core/dist/lib/cli-io.js +72 -0
- package/plugins/huaweicloud-core/dist/lib/credentials.js +173 -0
- package/plugins/huaweicloud-core/dist/lib/dep-resolve.js +64 -0
- package/plugins/huaweicloud-core/dist/lib/dependency-model.js +152 -0
- package/plugins/huaweicloud-core/dist/lib/hdkit/hdkitservice-api.js +217 -0
- package/plugins/huaweicloud-core/dist/lib/hdkit/hwlink-api.js +163 -0
- package/plugins/huaweicloud-core/dist/lib/hdkit/sandbox-pool.js +303 -0
- package/plugins/huaweicloud-core/dist/lib/hw-request-signing.js +57 -0
- package/plugins/huaweicloud-core/dist/lib/koocli-paths.js +18 -0
- package/plugins/huaweicloud-core/dist/lib/native-receipt.js +110 -0
- package/plugins/huaweicloud-core/dist/lib/opencode-permission-seam.js +132 -0
- package/plugins/huaweicloud-core/dist/lib/pack-state.js +179 -0
- package/plugins/huaweicloud-core/dist/lib/pack-types.js +21 -0
- package/plugins/huaweicloud-core/dist/lib/secret-vault/cli.js +273 -0
- package/plugins/huaweicloud-core/dist/lib/secret-vault/custody.js +396 -0
- package/plugins/huaweicloud-core/dist/lib/secret-vault/refs.js +63 -0
- package/plugins/huaweicloud-core/dist/lib/secret-vault/store.js +236 -0
- package/plugins/huaweicloud-core/dist/lib/skill-frontmatter.js +158 -0
- package/plugins/huaweicloud-core/dist/lib/skill-manifest.js +55 -0
- package/plugins/huaweicloud-core/dist/lib/skill-tree.js +44 -0
- package/plugins/huaweicloud-core/dist/lib/tool-schema-parts.js +66 -0
- package/plugins/huaweicloud-core/dist/mcp-agent-config.js +80 -0
- package/plugins/huaweicloud-core/dist/mcp-config-backup.js +74 -0
- package/plugins/huaweicloud-core/dist/mcp-config-io.js +195 -0
- package/plugins/huaweicloud-core/dist/mcp-config-merge.js +188 -0
- package/plugins/huaweicloud-core/dist/mcp-protocol.js +320 -0
- package/plugins/huaweicloud-core/dist/mcp-server.js +62136 -0
- package/plugins/huaweicloud-core/dist/mcp-server.js.map +7 -0
- package/plugins/huaweicloud-core/dist/mcp-stdio-transport.js +206 -0
- package/plugins/huaweicloud-core/dist/officeace-paths.js +142 -0
- package/plugins/huaweicloud-core/dist/packs/auth/pack.js +11 -0
- package/plugins/huaweicloud-core/dist/packs/auth/tools.js +276 -0
- package/plugins/huaweicloud-core/dist/packs/discovery/pack.js +11 -0
- package/plugins/huaweicloud-core/dist/packs/discovery/tools.js +78 -0
- package/plugins/huaweicloud-core/dist/packs/enable.js +81 -0
- package/plugins/huaweicloud-core/dist/packs/huaweicloud-cli/pack.js +39 -0
- package/plugins/huaweicloud-core/dist/packs/huaweicloud-cli/tools.js +435 -0
- package/plugins/huaweicloud-core/dist/packs/huaweicloud-open-mcp/approval.js +222 -0
- package/plugins/huaweicloud-core/dist/packs/huaweicloud-open-mcp/pack.js +17 -0
- package/plugins/huaweicloud-core/dist/packs/huaweicloud-open-mcp/sidecar.js +486 -0
- package/plugins/huaweicloud-core/dist/packs/huaweicloud-open-mcp/tools.js +134 -0
- package/plugins/huaweicloud-core/dist/packs/obs/pack.js +11 -0
- package/plugins/huaweicloud-core/dist/packs/obs/tools.js +425 -0
- package/plugins/huaweicloud-core/dist/packs/registry.js +143 -0
- package/plugins/huaweicloud-core/dist/packs/sandbox/git-transfer.js +79 -0
- package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-account.js +80 -0
- package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-credentials.js +138 -0
- package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-deploy.js +45 -0
- package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-session.js +48 -0
- package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-tunnel.js +59 -0
- package/plugins/huaweicloud-core/dist/packs/sandbox/handlers-upload.js +34 -0
- package/plugins/huaweicloud-core/dist/packs/sandbox/pack.js +14 -0
- package/plugins/huaweicloud-core/dist/packs/sandbox/schemas.js +191 -0
- package/plugins/huaweicloud-core/dist/packs/sandbox/tools.js +146 -0
- package/plugins/huaweicloud-core/dist/packs/secrets/pack.js +8 -0
- package/plugins/huaweicloud-core/dist/packs/secrets/tools.js +126 -0
- package/plugins/huaweicloud-core/dist/packs/update/pack.js +11 -0
- package/plugins/huaweicloud-core/dist/packs/update/tools.js +82 -0
- package/plugins/huaweicloud-core/dist/packs/voucher/pack.js +11 -0
- package/plugins/huaweicloud-core/dist/packs/voucher/tools.js +91 -0
- package/plugins/huaweicloud-core/dist/packs-cli/commands.js +108 -0
- package/plugins/huaweicloud-core/dist/packs-cli/doctor.js +81 -0
- package/plugins/huaweicloud-core/dist/packs-cli/report.js +133 -0
- package/plugins/huaweicloud-core/dist/packs-cli/slots.js +104 -0
- package/plugins/huaweicloud-core/dist/packs-cli/write-command.js +108 -0
- package/plugins/huaweicloud-core/dist/packs-cli/writers.js +115 -0
- package/plugins/huaweicloud-core/dist/packs-configure.js +81 -0
- package/plugins/huaweicloud-core/dist/packs-policy.js +149 -0
- package/plugins/huaweicloud-core/dist/payload-files.js +78 -0
- package/plugins/huaweicloud-core/dist/payload-native-clean.js +142 -0
- package/plugins/huaweicloud-core/dist/payload-native-sync.js +89 -0
- package/plugins/huaweicloud-core/dist/payload-placement.js +94 -0
- package/plugins/huaweicloud-core/dist/payload-roster.js +80 -0
- package/plugins/huaweicloud-core/dist/payload-runtime-deps.js +67 -0
- package/plugins/huaweicloud-core/dist/payload-status.js +43 -0
- package/plugins/huaweicloud-core/dist/payload-utils.js +42 -0
- package/plugins/huaweicloud-core/dist/preflight.js +232 -0
- package/plugins/huaweicloud-core/dist/proxy/cli.js +83 -0
- package/plugins/huaweicloud-core/dist/proxy/proxy-agent.js +92 -0
- package/plugins/huaweicloud-core/dist/proxy/proxy-bypass.js +83 -0
- package/plugins/huaweicloud-core/dist/proxy/proxy-cidr.js +105 -0
- package/plugins/huaweicloud-core/dist/proxy/proxy-config-io.js +61 -0
- package/plugins/huaweicloud-core/dist/proxy/proxy-config.js +10 -0
- package/plugins/huaweicloud-core/dist/risk-rule-engine.js +229 -0
- package/plugins/huaweicloud-core/dist/safety/classify-hcloud.js +191 -0
- package/plugins/huaweicloud-core/dist/safety/classify-text.js +1032 -0
- package/plugins/huaweicloud-core/dist/safety/command-operation.js +25 -0
- package/plugins/huaweicloud-core/dist/safety/credential-path.js +23 -0
- package/plugins/huaweicloud-core/dist/safety/default-policy.js +28 -0
- package/plugins/huaweicloud-core/dist/safety/feeder.js +119 -0
- package/plugins/huaweicloud-core/dist/safety/heredoc.js +95 -0
- package/plugins/huaweicloud-core/dist/safety/policy.js +75 -0
- package/plugins/huaweicloud-core/dist/safety/redact.js +42 -0
- package/plugins/huaweicloud-core/dist/safety/risk-merge.js +22 -0
- package/plugins/huaweicloud-core/dist/safety/script-stream.js +90 -0
- package/plugins/huaweicloud-core/dist/safety/secret-exec.js +44 -0
- package/plugins/huaweicloud-core/dist/safety/segments.js +138 -0
- package/plugins/huaweicloud-core/dist/safety/shell-text.js +414 -0
- package/plugins/huaweicloud-core/dist/safety/skill-quality-cli.js +152 -0
- package/plugins/huaweicloud-core/dist/safety/tokens.js +297 -0
- package/plugins/huaweicloud-core/dist/safety/unwrap.js +148 -0
- package/plugins/huaweicloud-core/dist/safety/vocabulary.js +37 -0
- package/plugins/huaweicloud-core/dist/safety/windows-rebase.js +56 -0
- package/plugins/huaweicloud-core/dist/safety/windows.js +137 -0
- package/plugins/huaweicloud-core/dist/safety/xargs-argv.js +64 -0
- package/plugins/huaweicloud-core/dist/safety-policy.js +14 -0
- package/plugins/huaweicloud-core/dist/sandbox/deploy-check.js +246 -0
- package/plugins/huaweicloud-core/dist/sandbox/deploy-nginx-verify.js +76 -0
- package/plugins/huaweicloud-core/dist/sandbox/deploy-nginx.js +215 -0
- package/plugins/huaweicloud-core/dist/sandbox/devbridge-auth.js +246 -0
- package/plugins/huaweicloud-core/dist/sandbox/devbridge-exec.js +10 -0
- package/plugins/huaweicloud-core/dist/sandbox/devbridge-expose-flow.js +225 -0
- package/plugins/huaweicloud-core/dist/sandbox/devbridge-expose.js +214 -0
- package/plugins/huaweicloud-core/dist/sandbox/devbridge-gateway.js +34 -0
- package/plugins/huaweicloud-core/dist/sandbox/devbridge-keepalive.js +212 -0
- package/plugins/huaweicloud-core/dist/sandbox/devbridge-key.js +175 -0
- package/plugins/huaweicloud-core/dist/sandbox/devbridge-renew.js +69 -0
- package/plugins/huaweicloud-core/dist/sandbox/devbridge-tunnel.js +48 -0
- package/plugins/huaweicloud-core/dist/sandbox/devbridge-validation.js +79 -0
- package/plugins/huaweicloud-core/dist/sandbox/devbridge-verify.js +101 -0
- package/plugins/huaweicloud-core/dist/sandbox/hwlink-connection.js +145 -0
- package/plugins/huaweicloud-core/dist/sandbox/sandbox-file-server.py +45 -0
- package/plugins/huaweicloud-core/dist/sandbox/sandbox-output.js +45 -0
- package/plugins/huaweicloud-core/dist/sandbox/session-manager.js +55 -0
- package/plugins/huaweicloud-core/dist/sandbox/tunnel-http.js +137 -0
- package/plugins/huaweicloud-core/dist/sandbox/uninstall-cleanup.js +45 -0
- package/plugins/huaweicloud-core/dist/sandbox/upload-diagnostics.js +45 -0
- package/plugins/huaweicloud-core/dist/sandbox/upload-file.js +119 -0
- package/plugins/huaweicloud-core/dist/sandbox/upload-project.js +171 -0
- package/plugins/huaweicloud-core/dist/sandbox/upload-transport.js +96 -0
- package/plugins/huaweicloud-core/dist/sandbox/ws-exec-loader.js +43 -0
- package/plugins/huaweicloud-core/dist/search-docs.js +64 -0
- package/plugins/huaweicloud-core/dist/search-market.js +277 -0
- package/plugins/huaweicloud-core/dist/services/availability.js +51 -0
- package/plugins/huaweicloud-core/dist/services/regions.js +110 -0
- package/plugins/huaweicloud-core/dist/setup-cli.js +1343 -0
- package/plugins/huaweicloud-core/dist/skill-disclosure.js +231 -0
- package/plugins/huaweicloud-core/dist/targets.js +139 -0
- package/plugins/huaweicloud-core/dist/telemetry/agent-detect.js +44 -0
- package/plugins/huaweicloud-core/dist/telemetry/agent-registry.js +196 -0
- package/plugins/huaweicloud-core/dist/telemetry/agent-versions-desktop.js +143 -0
- package/plugins/huaweicloud-core/dist/telemetry/agent-versions.js +78 -0
- package/plugins/huaweicloud-core/dist/telemetry/event-pipeline.js +206 -0
- package/plugins/huaweicloud-core/dist/telemetry/hook-ingest.js +81 -0
- package/plugins/huaweicloud-core/dist/telemetry/identity-stamps.js +104 -0
- package/plugins/huaweicloud-core/dist/telemetry/invoke-value.js +47 -0
- package/plugins/huaweicloud-core/dist/telemetry/telemetry-fs.js +42 -0
- package/plugins/huaweicloud-core/dist/telemetry/telemetry-types.js +14 -0
- package/plugins/huaweicloud-core/dist/telemetry/telemetry-values.js +121 -0
- package/plugins/huaweicloud-core/dist/telemetry/telemetry.js +262 -0
- package/plugins/huaweicloud-core/dist/tool-definitions.js +276 -0
- package/plugins/huaweicloud-core/dist/tool-schemas.js +156 -0
- package/plugins/huaweicloud-core/dist/tools.js +269 -0
- package/plugins/huaweicloud-core/dist/update-cache.js +79 -0
- package/plugins/huaweicloud-core/dist/update-check.js +23 -0
- package/plugins/huaweicloud-core/dist/update-hint.js +45 -0
- package/plugins/huaweicloud-core/dist/update-installed.js +53 -0
- package/plugins/huaweicloud-core/dist/update-registry.js +141 -0
- package/plugins/huaweicloud-core/dist/update-semver.js +76 -0
- package/plugins/huaweicloud-core/dist/update-skip.js +81 -0
- package/plugins/huaweicloud-core/dist/update-upgrade.js +94 -0
- package/plugins/huaweicloud-core/dist/vendor-gate.js +89 -0
- package/plugins/huaweicloud-core/dist/ws-exec/hwlink-exec-client.js +10 -0
- package/plugins/huaweicloud-core/dist/ws-exec/hwlink-exec-pending.js +71 -0
- package/plugins/huaweicloud-core/dist/ws-exec/hwlink-exec-session.js +235 -0
- package/plugins/huaweicloud-core/dist/ws-exec/hwlink-fair-queue.js +139 -0
- package/plugins/huaweicloud-core/dist/ws-exec/hwlink-interactive-terminal.js +106 -0
- package/plugins/huaweicloud-core/dist/ws-exec/hwlink-multiplexer.js +229 -0
- package/plugins/huaweicloud-core/dist/ws-exec/hwlink-normalize.js +53 -0
- package/plugins/huaweicloud-core/dist/ws-exec/hwlink-packet.js +148 -0
- package/plugins/huaweicloud-core/dist/ws-exec/hwlink-terminal-channel.js +155 -0
- package/plugins/huaweicloud-core/dist/ws-exec/hwlink-tunnel-channel.js +254 -0
- package/plugins/huaweicloud-core/dist/ws-exec/index.js +20 -0
- package/plugins/huaweicloud-core/dist/ws-exec/ws-exec-client.js +76 -0
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.mjs +62 -3
- package/plugins/huaweicloud-core/hooks/huaweicloud-safety.py +2500 -33
- package/plugins/huaweicloud-core/openclaw.plugin.json +2 -2
- package/plugins/huaweicloud-core/safety/policy.json +45 -4
- package/plugins/huaweicloud-core/safety/rules/cloud-risk-rules.json +47 -9
- package/plugins/huaweicloud-core/skills/.manifest.json +67 -0
- package/plugins/huaweicloud-core/skills/huawei-billing/SKILL.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-cbr/SKILL.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-cce/SKILL.md +3 -1
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/SKILL.md +27 -51
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/acceptance-criteria.md +10 -12
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/cli-installation-guide.md +23 -27
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/dataflow-diagram.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/iam-policies.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/references/verification-method.md +8 -16
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/scripts/cli/cli_entry.py +71 -461
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/scripts/ensure_cli.sh +28 -68
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/SKILL.md +56 -144
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/acceptance-criteria.md +14 -12
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/cli-installation-guide.md +72 -39
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/dataflow-diagram.md +3 -1
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/iam-policies.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/verification-method.md +12 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/scripts/cli/cli_entry.py +67 -307
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/scripts/ensure_cli.sh +28 -68
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/templates/test-defaults.json +1 -1
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/templates/test-vars.json +9 -9
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/SKILL.md +82 -160
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/acceptance-criteria.md +9 -8
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/cli-installation-guide.md +73 -40
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/dataflow-diagram.md +4 -2
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/iam-policies.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/related-commands.md +16 -14
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/references/verification-method.md +7 -20
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/scripts/cli/cli_entry.py +67 -307
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/scripts/ensure_cli.sh +28 -68
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/SKILL.md +92 -95
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/acceptance-criteria.md +11 -10
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/cli-installation-guide.md +86 -67
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/dataflow-diagram.md +4 -2
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/iam-policies.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/test-data-guide.md +29 -25
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/verification-method.md +13 -11
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/scripts/cli/cli_entry.py +67 -307
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/scripts/ensure_cli.sh +28 -68
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/SKILL.md +107 -127
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/acceptance-criteria.md +26 -25
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/cli-installation-guide.md +66 -51
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/csms-usage.md +23 -19
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/dataflow-diagram.md +4 -2
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/iam-policies.md +25 -30
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/kms-usage.md +13 -11
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/references/verification-method.md +13 -7
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/scripts/cli/cli_entry.py +67 -354
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/scripts/ensure_cli.sh +28 -69
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/templates/test-vars.json +11 -11
- package/plugins/huaweicloud-core/skills/huawei-cloud-eye/SKILL.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/SKILL.md +28 -109
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/acceptance-criteria.md +27 -31
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/cli-installation-guide.md +49 -24
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/dataflow-diagram.md +2 -5
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/iam-policies.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/references/verification-method.md +8 -25
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/cli/cli_entry.py +67 -307
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/ensure_cli.sh +28 -68
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/SKILL.md +60 -135
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/acceptance-criteria.md +9 -11
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/cli-installation-guide.md +16 -12
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/dataflow-diagram.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/engine-operation-reference.md +15 -13
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/iam-policies.md +9 -7
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/security-audit-guide.md +9 -5
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/references/verification-method.md +16 -37
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/scripts/cli/cli_entry.py +101 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/scripts/ensure_cli.sh +27 -184
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/SKILL.md +71 -103
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/acceptance-criteria.md +4 -2
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/cli-installation-guide.md +72 -84
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/dataflow-diagram.md +3 -3
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/iam-policies.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/related-commands.md +7 -5
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/references/verification-method.md +11 -9
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/scripts/cli/cli_entry.py +101 -0
- package/plugins/huaweicloud-core/skills/huawei-cloud-waf-aad-rule-management/scripts/ensure_cli.sh +27 -42
- package/plugins/huaweicloud-core/skills/huawei-ecs/SKILL.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/create-instance.md +24 -13
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/evs.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/flavors.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/hc-activity.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/troubleshooting.md +25 -21
- package/plugins/huaweicloud-core/skills/huawei-ecs/references/windows-ssh.md +7 -5
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/SKILL.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/apig-event-format.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/create-function.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/deploy-workflow.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-functiongraph/references/triggers.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-getting-started/SKILL.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-iac/SKILL.md +40 -38
- package/plugins/huaweicloud-core/skills/huawei-iac/references/architectures.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-iac/references/resource-catalog.md +14 -12
- package/plugins/huaweicloud-core/skills/huawei-iac/references/state-file.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-iam/SKILL.md +3 -1
- package/plugins/huaweicloud-core/skills/huawei-iam/references/policy-examples.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-iam/references/quick-ref.md +4 -1
- package/plugins/huaweicloud-core/skills/huawei-modelarts/SKILL.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-obs/SKILL.md +32 -29
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-create.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-obs/references/bucket-lifecycle.md +4 -2
- package/plugins/huaweicloud-core/skills/huawei-obs/references/common-pitfalls.md +17 -15
- package/plugins/huaweicloud-core/skills/huawei-obs/references/single-file-share.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-obs/references/static-website.md +10 -6
- package/plugins/huaweicloud-core/skills/huawei-openapi/SKILL.md +50 -0
- package/plugins/huaweicloud-core/skills/huawei-rds/SKILL.md +15 -13
- package/plugins/huaweicloud-core/skills/huawei-sandbox/SKILL.md +98 -91
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/framework-commands.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/fullstack-postgrest.md +33 -27
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/nginx-templates.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/resource-pool.md +3 -1
- package/plugins/huaweicloud-core/skills/huawei-sandbox/references/tunnel-persistence.md +9 -2
- package/plugins/huaweicloud-core/skills/huawei-voucher/SKILL.md +5 -3
- package/plugins/huaweicloud-core/skills/huawei-vpc/SKILL.md +3 -0
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/network.md +16 -0
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/security-group.md +2 -0
- package/plugins/huaweicloud-core/skills/huawei-vpc/references/subnet.md +2 -0
- package/plugins/huaweicloud-core/skills/huaweicloud-api-and-sdk/SKILL.md +3 -0
- package/plugins/huaweicloud-core/skills/huaweicloud-capability-discovery/SKILL.md +16 -13
- package/plugins/huaweicloud-core/skills/huaweicloud-cli-and-auth/SKILL.md +6 -11
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +38 -35
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/report-issue.md +2 -0
- package/plugins/huaweicloud-core/skills/huaweicloud-core/references/select.md +2 -0
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/SKILL.md +3 -0
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/references/secrets.md +32 -0
- package/plugins/huaweicloud-core/skills/huaweicloud-troubleshooting/SKILL.md +2 -0
- package/plugins/huaweicloud-core/src/agents/atomcode.ts +138 -0
- package/plugins/huaweicloud-core/src/agents/codearts-work.ts +136 -0
- package/plugins/huaweicloud-core/src/agents/codearts.ts +92 -0
- package/plugins/huaweicloud-core/src/agents/codex-desktop.ts +219 -0
- package/plugins/huaweicloud-core/src/agents/codex.ts +230 -0
- package/plugins/huaweicloud-core/src/agents/dsh-patch.ts +195 -0
- package/plugins/huaweicloud-core/src/agents/dsh.ts +153 -0
- package/plugins/huaweicloud-core/src/agents/hermes-config.ts +974 -0
- package/plugins/huaweicloud-core/src/agents/hermes-hook-plugin.ts +99 -0
- package/plugins/huaweicloud-core/src/agents/hermes-hooks.ts +187 -0
- package/plugins/huaweicloud-core/src/agents/hermes-sdk.ts +63 -0
- package/plugins/huaweicloud-core/src/agents/hermes.ts +192 -0
- package/plugins/huaweicloud-core/src/agents/officeace-registry.ts +188 -0
- package/plugins/huaweicloud-core/src/agents/officeace-sqlite.ts +153 -0
- package/plugins/huaweicloud-core/src/agents/officeace.ts +202 -0
- package/plugins/huaweicloud-core/src/agents/openclaw.ts +73 -0
- package/plugins/huaweicloud-core/src/agents/opencode-config.ts +193 -0
- package/plugins/huaweicloud-core/src/agents/opencode.ts +148 -0
- package/plugins/huaweicloud-core/src/agents/workbuddy.ts +216 -0
- package/plugins/huaweicloud-core/src/auth/account-type.ts +191 -0
- package/plugins/huaweicloud-core/src/auth/agent-registration.ts +267 -0
- package/plugins/huaweicloud-core/src/auth/cli.ts +133 -0
- package/plugins/huaweicloud-core/src/auth/codearts-context.ts +139 -0
- package/plugins/huaweicloud-core/src/auth/credential-placeholder.ts +36 -0
- package/plugins/huaweicloud-core/src/auth/credential-resolver.ts +81 -0
- package/plugins/huaweicloud-core/src/auth/credential-validator.ts +176 -0
- package/plugins/huaweicloud-core/src/auth/credentials.ts +52 -0
- package/plugins/huaweicloud-core/src/auth/{guidance.mjs → error-table.ts} +58 -12
- package/plugins/huaweicloud-core/src/auth/hcloud-profile.ts +119 -0
- package/plugins/huaweicloud-core/src/auth/init-cli.ts +155 -0
- package/plugins/huaweicloud-core/src/auth/missing-credential-error.ts +44 -0
- package/plugins/huaweicloud-core/src/auth/obs-config.ts +42 -0
- package/plugins/huaweicloud-core/src/auth/project-id.ts +104 -0
- package/plugins/huaweicloud-core/src/auth/reconcile.ts +345 -0
- package/plugins/huaweicloud-core/src/auth/runtime-credentials.ts +38 -0
- package/plugins/huaweicloud-core/src/auth/s1-store.ts +214 -0
- package/plugins/huaweicloud-core/src/auth/{service.mjs → service.ts} +210 -36
- package/plugins/huaweicloud-core/src/auth/sts-expiry.ts +58 -0
- package/plugins/huaweicloud-core/src/capability-catalog.ts +519 -0
- package/plugins/huaweicloud-core/src/codearts-sandbox.ts +32 -0
- package/plugins/huaweicloud-core/src/codex-probe.ts +86 -0
- package/plugins/huaweicloud-core/src/data/icons-manifest.v1.json +5 -23
- package/plugins/huaweicloud-core/src/dep/installers/gateway.ts +213 -0
- package/plugins/huaweicloud-core/src/dep/installers/hcloud.ts +407 -0
- package/plugins/huaweicloud-core/src/dep/installers/table.ts +123 -0
- package/plugins/huaweicloud-core/src/dep/provision.ts +335 -0
- package/plugins/huaweicloud-core/src/dep/receipts.ts +464 -0
- package/plugins/huaweicloud-core/src/detect-framework-match.ts +143 -0
- package/plugins/huaweicloud-core/src/detect-framework-pkg.ts +79 -0
- package/plugins/huaweicloud-core/src/detect-framework-scan.ts +117 -0
- package/plugins/huaweicloud-core/src/detect-framework-table.ts +166 -0
- package/plugins/huaweicloud-core/src/detect-framework.ts +8 -0
- package/plugins/huaweicloud-core/src/doctor-native.ts +189 -0
- package/plugins/huaweicloud-core/src/doctor-payload.ts +77 -0
- package/plugins/huaweicloud-core/src/doctor-report.ts +30 -0
- package/plugins/huaweicloud-core/src/explain-error.ts +246 -0
- package/plugins/huaweicloud-core/src/hcloud-api-error.ts +69 -0
- package/plugins/huaweicloud-core/src/hcloud-catalog.ts +115 -0
- package/plugins/huaweicloud-core/src/hcloud-cli.ts +41 -0
- package/plugins/huaweicloud-core/src/hcloud-obs-redact.ts +65 -0
- package/plugins/huaweicloud-core/src/hcloud-plan.ts +344 -0
- package/plugins/huaweicloud-core/src/{hcloud-probe.mjs → hcloud-probe.ts} +87 -60
- package/plugins/huaweicloud-core/src/hcloud-run-once.ts +251 -0
- package/plugins/huaweicloud-core/src/hcloud-run.ts +151 -0
- package/plugins/huaweicloud-core/src/hcloud-sg-preflight.ts +111 -0
- package/plugins/huaweicloud-core/src/hcloud-sts.ts +123 -0
- package/plugins/huaweicloud-core/src/hcloud-triage.ts +80 -0
- package/plugins/huaweicloud-core/src/{icon-library.mjs → icon-library.ts} +115 -23
- package/plugins/huaweicloud-core/src/install-payload.ts +63 -0
- package/plugins/huaweicloud-core/src/install-plan.ts +85 -0
- package/plugins/huaweicloud-core/src/install-prompts.ts +134 -0
- package/plugins/huaweicloud-core/src/koocli-version.ts +87 -0
- package/plugins/huaweicloud-core/src/lib/approval-tokens.ts +315 -0
- package/plugins/huaweicloud-core/src/lib/as-record.ts +10 -0
- package/plugins/huaweicloud-core/src/lib/as-text.ts +16 -0
- package/plugins/huaweicloud-core/src/lib/banner.ts +12 -0
- package/plugins/huaweicloud-core/src/lib/call-trace.ts +153 -0
- package/plugins/huaweicloud-core/src/lib/cli-io.ts +81 -0
- package/plugins/huaweicloud-core/src/lib/credentials.ts +202 -0
- package/plugins/huaweicloud-core/src/lib/dep-resolve.ts +107 -0
- package/plugins/huaweicloud-core/src/lib/dependency-model.ts +236 -0
- package/plugins/huaweicloud-core/src/{sandbox/hdkitservice-api.mjs → lib/hdkit/hdkitservice-api.ts} +99 -118
- package/plugins/huaweicloud-core/src/lib/hdkit/hwlink-api.ts +245 -0
- package/plugins/huaweicloud-core/src/{sandbox/sandbox-pool.mjs → lib/hdkit/sandbox-pool.ts} +115 -47
- package/plugins/huaweicloud-core/src/lib/hw-request-signing.ts +101 -0
- package/plugins/huaweicloud-core/src/lib/koocli-paths.ts +21 -0
- package/plugins/huaweicloud-core/src/lib/native-receipt.ts +131 -0
- package/plugins/huaweicloud-core/src/lib/opencode-permission-seam.ts +145 -0
- package/plugins/huaweicloud-core/src/lib/pack-state.ts +192 -0
- package/plugins/huaweicloud-core/src/lib/pack-types.ts +74 -0
- package/plugins/huaweicloud-core/src/lib/secret-vault/cli.ts +270 -0
- package/plugins/huaweicloud-core/src/lib/secret-vault/custody.ts +468 -0
- package/plugins/huaweicloud-core/src/lib/secret-vault/refs.ts +75 -0
- package/plugins/huaweicloud-core/src/lib/secret-vault/store.ts +357 -0
- package/plugins/huaweicloud-core/src/lib/skill-frontmatter.ts +164 -0
- package/plugins/huaweicloud-core/src/lib/skill-manifest.ts +55 -0
- package/plugins/huaweicloud-core/src/lib/skill-tree.ts +45 -0
- package/plugins/huaweicloud-core/src/lib/tool-schema-parts.ts +80 -0
- package/plugins/huaweicloud-core/src/mcp-agent-config.ts +90 -0
- package/plugins/huaweicloud-core/src/{mcp-config-backup.mjs → mcp-config-backup.ts} +14 -10
- package/plugins/huaweicloud-core/src/mcp-config-io.ts +215 -0
- package/plugins/huaweicloud-core/src/mcp-config-merge.ts +205 -0
- package/plugins/huaweicloud-core/src/mcp-protocol.ts +385 -0
- package/plugins/huaweicloud-core/src/mcp-server-remote.ts +178 -0
- package/plugins/huaweicloud-core/src/mcp-server.ts +87 -0
- package/plugins/huaweicloud-core/src/mcp-stdio-transport.ts +245 -0
- package/plugins/huaweicloud-core/src/officeace-paths.ts +146 -0
- package/plugins/huaweicloud-core/src/packs/auth/pack.ts +14 -0
- package/plugins/huaweicloud-core/src/packs/auth/tools.ts +327 -0
- package/plugins/huaweicloud-core/src/packs/discovery/pack.ts +14 -0
- package/plugins/huaweicloud-core/src/packs/discovery/tools.ts +97 -0
- package/plugins/huaweicloud-core/src/packs/enable.ts +90 -0
- package/plugins/huaweicloud-core/src/packs/huaweicloud-cli/pack.ts +42 -0
- package/plugins/huaweicloud-core/src/packs/huaweicloud-cli/tools.ts +493 -0
- package/plugins/huaweicloud-core/src/packs/huaweicloud-open-mcp/approval.ts +250 -0
- package/plugins/huaweicloud-core/src/packs/huaweicloud-open-mcp/pack.ts +19 -0
- package/plugins/huaweicloud-core/src/packs/huaweicloud-open-mcp/sidecar.ts +603 -0
- package/plugins/huaweicloud-core/src/packs/huaweicloud-open-mcp/tools.ts +155 -0
- package/plugins/huaweicloud-core/src/packs/obs/pack.ts +13 -0
- package/plugins/huaweicloud-core/src/packs/obs/tools.ts +487 -0
- package/plugins/huaweicloud-core/src/packs/registry.ts +162 -0
- package/plugins/huaweicloud-core/src/packs/sandbox/git-transfer.ts +93 -0
- package/plugins/huaweicloud-core/src/packs/sandbox/handlers-account.ts +93 -0
- package/plugins/huaweicloud-core/src/packs/sandbox/handlers-credentials.ts +144 -0
- package/plugins/huaweicloud-core/src/packs/sandbox/handlers-deploy.ts +63 -0
- package/plugins/huaweicloud-core/src/packs/sandbox/handlers-session.ts +59 -0
- package/plugins/huaweicloud-core/src/packs/sandbox/handlers-tunnel.ts +101 -0
- package/plugins/huaweicloud-core/src/packs/sandbox/handlers-upload.ts +46 -0
- package/plugins/huaweicloud-core/src/packs/sandbox/pack.ts +16 -0
- package/plugins/huaweicloud-core/src/packs/sandbox/schemas.ts +249 -0
- package/plugins/huaweicloud-core/src/packs/sandbox/tools.ts +183 -0
- package/plugins/huaweicloud-core/src/packs/secrets/pack.ts +11 -0
- package/plugins/huaweicloud-core/src/packs/secrets/tools.ts +146 -0
- package/plugins/huaweicloud-core/src/packs/update/pack.ts +13 -0
- package/plugins/huaweicloud-core/src/packs/update/tools.ts +107 -0
- package/plugins/huaweicloud-core/src/packs/voucher/pack.ts +13 -0
- package/plugins/huaweicloud-core/src/packs/voucher/tools.ts +112 -0
- package/plugins/huaweicloud-core/src/packs-cli/commands.ts +121 -0
- package/plugins/huaweicloud-core/src/packs-cli/doctor.ts +85 -0
- package/plugins/huaweicloud-core/src/packs-cli/report.ts +171 -0
- package/plugins/huaweicloud-core/src/packs-cli/slots.ts +139 -0
- package/plugins/huaweicloud-core/src/packs-cli/write-command.ts +114 -0
- package/plugins/huaweicloud-core/src/packs-cli/writers.ts +125 -0
- package/plugins/huaweicloud-core/src/packs-configure.ts +104 -0
- package/plugins/huaweicloud-core/src/packs-policy.ts +203 -0
- package/plugins/huaweicloud-core/src/payload-files.ts +78 -0
- package/plugins/huaweicloud-core/src/payload-native-clean.ts +154 -0
- package/plugins/huaweicloud-core/src/payload-native-sync.ts +110 -0
- package/plugins/huaweicloud-core/src/payload-placement.ts +107 -0
- package/plugins/huaweicloud-core/src/payload-roster.ts +85 -0
- package/plugins/huaweicloud-core/src/payload-runtime-deps.ts +68 -0
- package/plugins/huaweicloud-core/src/payload-status.ts +53 -0
- package/plugins/huaweicloud-core/src/payload-utils.ts +51 -0
- package/plugins/huaweicloud-core/src/preflight.ts +250 -0
- package/plugins/huaweicloud-core/src/proxy/cli.ts +103 -0
- package/plugins/huaweicloud-core/src/proxy/{proxy-agent.mjs → proxy-agent.ts} +25 -16
- package/plugins/huaweicloud-core/src/proxy/proxy-bypass.ts +90 -0
- package/plugins/huaweicloud-core/src/proxy/proxy-cidr.ts +98 -0
- package/plugins/huaweicloud-core/src/proxy/proxy-config-io.ts +73 -0
- package/plugins/huaweicloud-core/src/proxy/proxy-config.ts +18 -0
- package/plugins/huaweicloud-core/src/risk-rule-engine.ts +325 -0
- package/plugins/huaweicloud-core/src/safety/classify-hcloud.ts +246 -0
- package/plugins/huaweicloud-core/src/safety/classify-text.ts +1099 -0
- package/plugins/huaweicloud-core/src/safety/command-operation.ts +28 -0
- package/plugins/huaweicloud-core/src/safety/credential-path.ts +25 -0
- package/plugins/huaweicloud-core/src/safety/default-policy.ts +34 -0
- package/plugins/huaweicloud-core/src/safety/feeder.ts +140 -0
- package/plugins/huaweicloud-core/src/safety/heredoc.ts +100 -0
- package/plugins/huaweicloud-core/src/safety/policy.ts +109 -0
- package/plugins/huaweicloud-core/src/safety/redact.ts +63 -0
- package/plugins/huaweicloud-core/src/safety/risk-merge.ts +31 -0
- package/plugins/huaweicloud-core/src/safety/script-stream.ts +95 -0
- package/plugins/huaweicloud-core/src/safety/secret-exec.ts +42 -0
- package/plugins/huaweicloud-core/src/safety/segments.ts +153 -0
- package/plugins/huaweicloud-core/src/safety/shell-text.ts +415 -0
- package/plugins/huaweicloud-core/src/safety/skill-quality-cli.ts +141 -0
- package/plugins/huaweicloud-core/src/safety/tokens.ts +322 -0
- package/plugins/huaweicloud-core/src/safety/unwrap.ts +162 -0
- package/plugins/huaweicloud-core/src/safety/vocabulary.ts +38 -0
- package/plugins/huaweicloud-core/src/safety/windows-rebase.ts +56 -0
- package/plugins/huaweicloud-core/src/safety/windows.ts +133 -0
- package/plugins/huaweicloud-core/src/safety/xargs-argv.ts +79 -0
- package/plugins/huaweicloud-core/src/safety-policy.ts +16 -0
- package/plugins/huaweicloud-core/src/sandbox/deploy-check.ts +307 -0
- package/plugins/huaweicloud-core/src/sandbox/deploy-nginx-verify.ts +96 -0
- package/plugins/huaweicloud-core/src/sandbox/deploy-nginx.ts +300 -0
- package/plugins/huaweicloud-core/src/sandbox/devbridge-auth.ts +291 -0
- package/plugins/huaweicloud-core/src/sandbox/devbridge-exec.ts +28 -0
- package/plugins/huaweicloud-core/src/sandbox/devbridge-expose-flow.ts +289 -0
- package/plugins/huaweicloud-core/src/sandbox/devbridge-expose.ts +310 -0
- package/plugins/huaweicloud-core/src/sandbox/devbridge-gateway.ts +36 -0
- package/plugins/huaweicloud-core/src/sandbox/devbridge-keepalive.ts +254 -0
- package/plugins/huaweicloud-core/src/sandbox/{devbridge-key.mjs → devbridge-key.ts} +48 -32
- package/plugins/huaweicloud-core/src/sandbox/devbridge-renew.ts +87 -0
- package/plugins/huaweicloud-core/src/sandbox/devbridge-tunnel.ts +79 -0
- package/plugins/huaweicloud-core/src/sandbox/devbridge-validation.ts +100 -0
- package/plugins/huaweicloud-core/src/sandbox/devbridge-verify.ts +120 -0
- package/plugins/huaweicloud-core/src/sandbox/hwlink-connection.ts +188 -0
- package/plugins/huaweicloud-core/src/sandbox/sandbox-output.ts +46 -0
- package/plugins/huaweicloud-core/src/sandbox/session-manager.ts +89 -0
- package/plugins/huaweicloud-core/src/sandbox/tunnel-http.ts +155 -0
- package/plugins/huaweicloud-core/src/sandbox/{uninstall-cleanup.mjs → uninstall-cleanup.ts} +4 -4
- package/plugins/huaweicloud-core/src/sandbox/upload-diagnostics.ts +46 -0
- package/plugins/huaweicloud-core/src/sandbox/upload-file.ts +161 -0
- package/plugins/huaweicloud-core/src/sandbox/upload-project.ts +218 -0
- package/plugins/huaweicloud-core/src/sandbox/upload-transport.ts +150 -0
- package/plugins/huaweicloud-core/src/sandbox/ws-exec-loader.ts +104 -0
- package/plugins/huaweicloud-core/src/search-docs.ts +64 -0
- package/plugins/huaweicloud-core/src/{search-market.mjs → search-market.ts} +96 -28
- package/plugins/huaweicloud-core/src/services/availability.ts +53 -0
- package/plugins/huaweicloud-core/src/services/regions.ts +110 -0
- package/plugins/huaweicloud-core/src/setup-cli.ts +1563 -0
- package/plugins/huaweicloud-core/src/skill-disclosure.ts +242 -0
- package/plugins/huaweicloud-core/src/targets.ts +156 -0
- package/plugins/huaweicloud-core/src/telemetry/{agent-detect.mjs → agent-detect.ts} +16 -5
- package/plugins/huaweicloud-core/src/telemetry/agent-registry.ts +210 -0
- package/plugins/huaweicloud-core/src/telemetry/agent-versions-desktop.ts +138 -0
- package/plugins/huaweicloud-core/src/telemetry/agent-versions.ts +84 -0
- package/plugins/huaweicloud-core/src/telemetry/event-pipeline.ts +214 -0
- package/plugins/huaweicloud-core/src/telemetry/hook-ingest.ts +82 -0
- package/plugins/huaweicloud-core/src/telemetry/identity-stamps.ts +108 -0
- package/plugins/huaweicloud-core/src/telemetry/invoke-value.ts +47 -0
- package/plugins/huaweicloud-core/src/telemetry/telemetry-fs.ts +47 -0
- package/plugins/huaweicloud-core/src/telemetry/telemetry-types.ts +97 -0
- package/plugins/huaweicloud-core/src/telemetry/telemetry-values.ts +116 -0
- package/plugins/huaweicloud-core/src/telemetry/telemetry.ts +299 -0
- package/plugins/huaweicloud-core/src/tool-definitions.ts +294 -0
- package/plugins/huaweicloud-core/src/tool-schemas.ts +180 -0
- package/plugins/huaweicloud-core/src/tools.ts +417 -0
- package/plugins/huaweicloud-core/src/update-cache.ts +95 -0
- package/plugins/huaweicloud-core/src/update-check.ts +51 -0
- package/plugins/huaweicloud-core/src/update-hint.ts +82 -0
- package/plugins/huaweicloud-core/src/update-installed.ts +53 -0
- package/plugins/huaweicloud-core/src/update-registry.ts +146 -0
- package/plugins/huaweicloud-core/src/update-semver.ts +80 -0
- package/plugins/huaweicloud-core/src/update-skip.ts +94 -0
- package/plugins/huaweicloud-core/src/update-upgrade.ts +123 -0
- package/plugins/huaweicloud-core/src/vendor-gate.ts +103 -0
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.ts +15 -0
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-pending.ts +113 -0
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-session.ts +334 -0
- package/plugins/huaweicloud-core/src/ws-exec/{hwlink-fair-queue.js → hwlink-fair-queue.ts} +46 -15
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-interactive-terminal.ts +158 -0
- package/plugins/huaweicloud-core/src/ws-exec/{hwlink-multiplexer.js → hwlink-multiplexer.ts} +108 -30
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-normalize.ts +60 -0
- package/plugins/huaweicloud-core/src/ws-exec/{hwlink-packet.js → hwlink-packet.ts} +40 -16
- package/plugins/huaweicloud-core/src/ws-exec/{hwlink-terminal-channel.js → hwlink-terminal-channel.ts} +30 -18
- package/plugins/huaweicloud-core/src/ws-exec/{hwlink-tunnel-channel.mjs → hwlink-tunnel-channel.ts} +75 -27
- package/plugins/huaweicloud-core/src/ws-exec/{index.js → index.ts} +11 -11
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.ts +102 -0
- package/plugins/huaweicloud-core/tsconfig.json +21 -0
- package/rules/huawei-agent-rules.mdc +2 -2
- package/integrations/hermes/skills-snapshot.json +0 -175
- package/integrations/opencode/skills/huaweicloud-core/SKILL.md +0 -32
- package/plugins/huaweicloud-core/skills/huawei-cloud-apig-instance-management/scripts/cli/cli_reporting.py +0 -589
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/references/test-report.md +0 -35
- package/plugins/huaweicloud-core/skills/huawei-cloud-cts-trace-management/scripts/cli/cli_reporting.py +0 -928
- package/plugins/huaweicloud-core/skills/huawei-cloud-dds-dcs-instance-management/scripts/cli/cli_reporting.py +0 -928
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/references/test-report.md +0 -52
- package/plugins/huaweicloud-core/skills/huawei-cloud-deployment-task-management/scripts/cli/cli_reporting.py +0 -928
- package/plugins/huaweicloud-core/skills/huawei-cloud-dew-key-management/scripts/cli/cli_reporting.py +0 -577
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/cli/cli_reporting.py +0 -928
- package/plugins/huaweicloud-core/skills/huawei-cloud-gaussdb-instance-management/scripts/gaussdb_cli.sh +0 -138
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/scripts/install_cli.sh +0 -94
- package/plugins/huaweicloud-core/skills/huawei-cloud-smn-dms-message/scripts/smn_dms_skill.py +0 -444
- package/plugins/huaweicloud-core/src/account-type.mjs +0 -135
- package/plugins/huaweicloud-core/src/auth/agent-registration.mjs +0 -243
- package/plugins/huaweicloud-core/src/auth/credential-validator.mjs +0 -198
- package/plugins/huaweicloud-core/src/auth/credentials.mjs +0 -446
- package/plugins/huaweicloud-core/src/auth/project-id.mjs +0 -68
- package/plugins/huaweicloud-core/src/auth/reconcile.mjs +0 -257
- package/plugins/huaweicloud-core/src/detect-framework.mjs +0 -402
- package/plugins/huaweicloud-core/src/hcloud-cli.mjs +0 -825
- package/plugins/huaweicloud-core/src/koocli-version.mjs +0 -47
- package/plugins/huaweicloud-core/src/mcp-config-merge.mjs +0 -219
- package/plugins/huaweicloud-core/src/mcp-protocol.mjs +0 -109
- package/plugins/huaweicloud-core/src/mcp-server-remote.mjs +0 -108
- package/plugins/huaweicloud-core/src/mcp-server.mjs +0 -221
- package/plugins/huaweicloud-core/src/officeace-paths.mjs +0 -51
- package/plugins/huaweicloud-core/src/preflight.mjs +0 -125
- package/plugins/huaweicloud-core/src/proxy/proxy-config.mjs +0 -187
- package/plugins/huaweicloud-core/src/risk-rule-engine.mjs +0 -182
- package/plugins/huaweicloud-core/src/safety-policy.mjs +0 -625
- package/plugins/huaweicloud-core/src/sandbox/hwlink-api.mjs +0 -224
- package/plugins/huaweicloud-core/src/sandbox/session-manager.mjs +0 -2594
- package/plugins/huaweicloud-core/src/setup-cli.mjs +0 -5379
- package/plugins/huaweicloud-core/src/telemetry/agent-registry.mjs +0 -341
- package/plugins/huaweicloud-core/src/telemetry/telemetry.mjs +0 -492
- package/plugins/huaweicloud-core/src/tools.mjs +0 -3190
- package/plugins/huaweicloud-core/src/update-check.mjs +0 -476
- package/plugins/huaweicloud-core/src/ws-exec/hwlink-exec-client.js +0 -461
- package/plugins/huaweicloud-core/src/ws-exec/ws-exec-client.js +0 -365
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {
|
|
2
|
+
exposeTunnel,
|
|
3
|
+
renewTunnel,
|
|
4
|
+
installKeepaliveWatchdog,
|
|
5
|
+
validateTunnelId,
|
|
6
|
+
} from '../../sandbox/devbridge-tunnel.ts';
|
|
7
|
+
import { getCurrentWorkspaceId } from '../../sandbox/session-manager.ts';
|
|
8
|
+
import { poolContextFor } from '../../lib/hdkit/sandbox-pool.ts';
|
|
9
|
+
import {
|
|
10
|
+
buildKeyringInjectScript,
|
|
11
|
+
ensureDevbridgeKey,
|
|
12
|
+
listKeysForQuotaHint,
|
|
13
|
+
recreateDevbridgeKey,
|
|
14
|
+
} from '../../sandbox/devbridge-key.ts';
|
|
15
|
+
import type { CallToolOptions, ToolArgs } from '../../tools.ts';
|
|
16
|
+
import { SANDBOX_TIMEOUT_MS } from './schemas.ts';
|
|
17
|
+
|
|
18
|
+
// Tunnel handlers (expose/renew/keepalive-watchdog) for the sandbox pack,
|
|
19
|
+
// extracted verbatim from tools.ts in the within-pack split for the jscpd
|
|
20
|
+
// complex-file bar; the tools.ts face imports them for SANDBOX_TOOL_HANDLERS.
|
|
21
|
+
|
|
22
|
+
export async function handleExposeTunnel(args: ToolArgs = {}, _opts: CallToolOptions = {}) {
|
|
23
|
+
if (!args.port) {
|
|
24
|
+
throw new Error(
|
|
25
|
+
'port is required. Use the ACTUAL "port" value returned by huaweicloud_sandbox_deploy_nginx (it may have been auto-incremented on a port conflict).',
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
const sandboxWsId9 = args.workspace_id || getCurrentWorkspaceId();
|
|
29
|
+
if (!sandboxWsId9) {
|
|
30
|
+
throw new Error(
|
|
31
|
+
'workspace_id is required. No sandbox connected — call huaweicloud_sandbox_connect first, ' +
|
|
32
|
+
'or set HW_WORKSPACE_ID environment variable before starting the agent.',
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
const sandboxUser9 = args.username || 'root';
|
|
36
|
+
const sandboxTimeout9 = args.timeout_ms || SANDBOX_TIMEOUT_MS.expose_tunnel;
|
|
37
|
+
const exposePoolContext = poolContextFor(sandboxWsId9);
|
|
38
|
+
return await exposeTunnel(
|
|
39
|
+
sandboxWsId9,
|
|
40
|
+
{
|
|
41
|
+
port: args.port,
|
|
42
|
+
expiryHours: typeof args.expiry_hours === 'number' ? args.expiry_hours : undefined,
|
|
43
|
+
keepalive: typeof args.keepalive === 'boolean' ? args.keepalive : undefined,
|
|
44
|
+
// DevBridge API Key 自动创建兜底(认证固定 apikey,AK/SK 已移除)
|
|
45
|
+
poolType: exposePoolContext?.poolMode || 'ephemeral',
|
|
46
|
+
poolContext: exposePoolContext,
|
|
47
|
+
keyUpgrade: { ensureDevbridgeKey, recreateDevbridgeKey, buildKeyringInjectScript, listKeysForQuotaHint },
|
|
48
|
+
},
|
|
49
|
+
sandboxUser9,
|
|
50
|
+
sandboxTimeout9,
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export async function handleRenewTunnel(args: ToolArgs = {}, _opts: CallToolOptions = {}) {
|
|
55
|
+
if (!args.tunnel_id) {
|
|
56
|
+
throw new Error(
|
|
57
|
+
'tunnel_id is required. Get it from huaweicloud_sandbox_expose_tunnel or extract it from the public URL (https://<tunnel_id>-<port>.devbridge-s2.hwtunnel.com).',
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
const wsId = args.workspace_id || getCurrentWorkspaceId();
|
|
61
|
+
if (!wsId) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
'workspace_id is required. No sandbox connected — call huaweicloud_sandbox_connect first, ' +
|
|
64
|
+
'or set HW_WORKSPACE_ID environment variable before starting the agent.',
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
// Fail fast on a malformed ID before any exec (the validator's error names
|
|
68
|
+
// the expected shape).
|
|
69
|
+
validateTunnelId(args.tunnel_id);
|
|
70
|
+
return await renewTunnel(
|
|
71
|
+
wsId,
|
|
72
|
+
{ tunnelId: args.tunnel_id, expiryHours: typeof args.expiry_hours === 'number' ? args.expiry_hours : undefined },
|
|
73
|
+
args.username || 'root',
|
|
74
|
+
args.timeout_ms || SANDBOX_TIMEOUT_MS.renew_tunnel,
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export async function handleKeepaliveWatchdog(args: ToolArgs = {}, _opts: CallToolOptions = {}) {
|
|
79
|
+
if (!Array.isArray(args.tunnels) || args.tunnels.length === 0) {
|
|
80
|
+
throw new Error(
|
|
81
|
+
'tunnels is required — a non-empty array of {tunnel_id, url} from huaweicloud_sandbox_expose_tunnel results.',
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
const wsId = args.workspace_id || getCurrentWorkspaceId();
|
|
85
|
+
if (!wsId) {
|
|
86
|
+
throw new Error(
|
|
87
|
+
'workspace_id is required. No sandbox connected — call huaweicloud_sandbox_connect first, ' +
|
|
88
|
+
'or set HW_WORKSPACE_ID environment variable before starting the agent.',
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
const tunnels = (args.tunnels as Array<Record<string, unknown>>).map((t) => ({
|
|
92
|
+
tunnelId: t.tunnel_id ?? t.tunnelId,
|
|
93
|
+
url: t.url,
|
|
94
|
+
}));
|
|
95
|
+
return await installKeepaliveWatchdog(
|
|
96
|
+
wsId,
|
|
97
|
+
{ tunnels },
|
|
98
|
+
args.username || 'root',
|
|
99
|
+
args.timeout_ms || SANDBOX_TIMEOUT_MS.keepalive_watchdog,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
uploadFileWithSession,
|
|
3
|
+
uploadProjectWithSession,
|
|
4
|
+
getCurrentWorkspaceId,
|
|
5
|
+
} from '../../sandbox/session-manager.ts';
|
|
6
|
+
import type { CallToolOptions, ToolArgs } from '../../tools.ts';
|
|
7
|
+
import { SANDBOX_TIMEOUT_MS } from './schemas.ts';
|
|
8
|
+
|
|
9
|
+
// Upload handlers for the sandbox pack, extracted verbatim from tools.ts in
|
|
10
|
+
// the within-pack split for the jscpd complex-file bar; the tools.ts face
|
|
11
|
+
// imports them for SANDBOX_TOOL_HANDLERS.
|
|
12
|
+
|
|
13
|
+
export async function handleUploadFile(args: ToolArgs = {}, _opts: CallToolOptions = {}) {
|
|
14
|
+
if (!args.local_path || !args.remote_path) {
|
|
15
|
+
throw new Error('local_path and remote_path are required.');
|
|
16
|
+
}
|
|
17
|
+
const sandboxWsId5 = args.workspace_id || getCurrentWorkspaceId();
|
|
18
|
+
if (!sandboxWsId5) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
'workspace_id is required. No sandbox connected — call huaweicloud_sandbox_connect first, ' +
|
|
21
|
+
'or set HW_WORKSPACE_ID environment variable before starting the agent.',
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
const sandboxUser5 = args.username || 'root';
|
|
25
|
+
const sandboxTimeout5 = args.timeout_ms || SANDBOX_TIMEOUT_MS.upload_file;
|
|
26
|
+
return await uploadFileWithSession(sandboxWsId5, args.local_path, args.remote_path, sandboxUser5, sandboxTimeout5);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export async function handleUploadProject(args: ToolArgs = {}, _opts: CallToolOptions = {}) {
|
|
30
|
+
if (!args.local_dir) {
|
|
31
|
+
throw new Error('local_dir is required.');
|
|
32
|
+
}
|
|
33
|
+
const sandboxWsId6 = args.workspace_id || getCurrentWorkspaceId();
|
|
34
|
+
if (!sandboxWsId6) {
|
|
35
|
+
throw new Error(
|
|
36
|
+
'workspace_id is required. No sandbox connected — call huaweicloud_sandbox_connect first, ' +
|
|
37
|
+
'or set HW_WORKSPACE_ID environment variable before starting the agent.',
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
const sandboxUser6 = args.username || 'root';
|
|
41
|
+
const sandboxTimeout6 = args.timeout_ms || SANDBOX_TIMEOUT_MS.upload_project;
|
|
42
|
+
return await uploadProjectWithSession(sandboxWsId6, args.local_dir, args.remote_dir, sandboxUser6, sandboxTimeout6, {
|
|
43
|
+
exclude: args.exclude,
|
|
44
|
+
extract: args.extract,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Pack } from '../../lib/pack-types.ts';
|
|
2
|
+
import { SANDBOX_TOOLS } from './tools.ts';
|
|
3
|
+
|
|
4
|
+
// The sandbox pack manifest. registry.ts references this from PACKS; the tool
|
|
5
|
+
// list is derived from the pack's own definitions, and PACK_OF stays the
|
|
6
|
+
// tool-ownership source of truth (structure.test.ts asserts the lockstep).
|
|
7
|
+
// The pack's binary dependency (devbridge) is declared in
|
|
8
|
+
// lib/dependency-model.ts PACK_DEPENDENCIES, not here.
|
|
9
|
+
export const sandboxPack: Pack = {
|
|
10
|
+
id: 'sandbox',
|
|
11
|
+
title: 'Sandbox',
|
|
12
|
+
description:
|
|
13
|
+
'Cloud sandbox workspace terminals: session and one-shot execution, file and project upload, nginx deployment and deployment checks, and hdkitservice onboarding.',
|
|
14
|
+
skills: ['huawei-sandbox'],
|
|
15
|
+
tools: SANDBOX_TOOLS.map((tool) => tool.name),
|
|
16
|
+
};
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
numericArg,
|
|
5
|
+
looseObject,
|
|
6
|
+
gitConfig,
|
|
7
|
+
workspaceId,
|
|
8
|
+
username,
|
|
9
|
+
vendorConfirmed,
|
|
10
|
+
} from '../../lib/tool-schema-parts.ts';
|
|
11
|
+
|
|
12
|
+
// The sandbox pack's zod schema family, extracted from tools.ts in the
|
|
13
|
+
// within-pack split for the jscpd complex-file bar. tools.ts stays the stable
|
|
14
|
+
// face: it imports every schema here for the SANDBOX_TOOLS /
|
|
15
|
+
// SANDBOX_TOOL_SCHEMAS arrays and re-exports SANDBOX_TIMEOUT_MS, so no
|
|
16
|
+
// consumer import changes. zod is allowed here (the pack compiles into the
|
|
17
|
+
// bundled mcp-server graph); the SDK is not.
|
|
18
|
+
|
|
19
|
+
// The single source for each tool's timeout default. The zod schema text
|
|
20
|
+
// and the handler fallback must agree, and direct callTool callers bypass
|
|
21
|
+
// SDK schema application, so the handler fallback stays — both read this.
|
|
22
|
+
export const SANDBOX_TIMEOUT_MS = {
|
|
23
|
+
exec_with_session: 120000,
|
|
24
|
+
exec_one_shot: 120000,
|
|
25
|
+
upload_file: 120000,
|
|
26
|
+
upload_project: 120000,
|
|
27
|
+
deploy_nginx: 60000,
|
|
28
|
+
// Bounded per-tunnel probing can spend up to 5 × 5s of curl alone plus
|
|
29
|
+
// devbridge list round-trips — the probe loop must fit the budget instead
|
|
30
|
+
// of dying as a ws-exec timeout (the pre-probing 30s default did not).
|
|
31
|
+
deploy_check: 60000,
|
|
32
|
+
// The expose script's A2 (#935) bounded waits can spend ~63s in one exec
|
|
33
|
+
// (2s settle + up to 9s URL-extraction retries + 4 × 10s probes + 3 × 5s
|
|
34
|
+
// backoff) plus the delete-all round-trip — the headroom exists for the
|
|
35
|
+
// slow-gateway days the probe loop exists for, and a timeout still folds
|
|
36
|
+
// into the structured unreachable envelope (never a raw ws error).
|
|
37
|
+
expose_tunnel: 90000,
|
|
38
|
+
renew_tunnel: 60000,
|
|
39
|
+
keepalive_watchdog: 60000,
|
|
40
|
+
} as const;
|
|
41
|
+
|
|
42
|
+
export const execWithSessionSchema = z.looseObject({
|
|
43
|
+
command: z.string().describe('The shell command to execute on the remote workspace'),
|
|
44
|
+
workspace_id: workspaceId,
|
|
45
|
+
username,
|
|
46
|
+
timeout_ms: numericArg
|
|
47
|
+
.optional()
|
|
48
|
+
.describe(`Execution timeout in milliseconds (default: ${SANDBOX_TIMEOUT_MS.exec_with_session})`),
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export const execOneShotSchema = z.looseObject({
|
|
52
|
+
command: z.string().describe('The shell command to execute on the remote workspace'),
|
|
53
|
+
workspace_id: workspaceId,
|
|
54
|
+
username,
|
|
55
|
+
timeout_ms: numericArg
|
|
56
|
+
.optional()
|
|
57
|
+
.describe(`Execution timeout in milliseconds (default: ${SANDBOX_TIMEOUT_MS.exec_one_shot})`),
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
export const closeSessionSchema = z.looseObject({
|
|
61
|
+
workspace_id: workspaceId,
|
|
62
|
+
username,
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export const uploadFileSchema = z.looseObject({
|
|
66
|
+
local_path: z
|
|
67
|
+
.string()
|
|
68
|
+
.describe(
|
|
69
|
+
'Absolute path to the local file, readable from the machine running the DevKit MCP server (copy to the local temp dir first if not).',
|
|
70
|
+
),
|
|
71
|
+
remote_path: z
|
|
72
|
+
.string()
|
|
73
|
+
.describe(
|
|
74
|
+
'Target path in the sandbox, e.g. /workspace/<repo>/index.html. The remote parent directory is created automatically if absent.',
|
|
75
|
+
),
|
|
76
|
+
workspace_id: workspaceId,
|
|
77
|
+
username,
|
|
78
|
+
timeout_ms: numericArg
|
|
79
|
+
.optional()
|
|
80
|
+
.describe(`Execution timeout in milliseconds (default: ${SANDBOX_TIMEOUT_MS.upload_file})`),
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export const uploadProjectSchema = z.looseObject({
|
|
84
|
+
local_dir: z
|
|
85
|
+
.string()
|
|
86
|
+
.describe(
|
|
87
|
+
'Local project directory, readable from the machine running the DevKit MCP server (copy to the local temp dir first if not).',
|
|
88
|
+
),
|
|
89
|
+
remote_dir: z
|
|
90
|
+
.string()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe(
|
|
93
|
+
'Remote parent directory where project will be extracted (default: /workspace). Final layout: <remote_dir>/<dirname>/',
|
|
94
|
+
),
|
|
95
|
+
workspace_id: workspaceId,
|
|
96
|
+
username,
|
|
97
|
+
exclude: z
|
|
98
|
+
.array(z.string())
|
|
99
|
+
.optional()
|
|
100
|
+
.describe('Patterns to exclude from archive (default: .git, node_modules, __pycache__, .venv)'),
|
|
101
|
+
extract: z.boolean().optional().describe('Extract tar.gz on sandbox after upload (default: true)'),
|
|
102
|
+
timeout_ms: numericArg
|
|
103
|
+
.optional()
|
|
104
|
+
.describe(`Execution timeout in milliseconds (default: ${SANDBOX_TIMEOUT_MS.upload_project})`),
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
export const deployNginxSchema = z.looseObject({
|
|
108
|
+
nginx_type: z
|
|
109
|
+
.enum(['spa', 'proxy', 'static'])
|
|
110
|
+
.describe(
|
|
111
|
+
'Nginx config type from framework detection: spa (try_files fallback for SPA/SSG/cross-platform), proxy (reverse proxy for SSR), or static (plain root for Hugo/Hexo).',
|
|
112
|
+
),
|
|
113
|
+
port: numericArg.describe('Listen port (from framework detection).'),
|
|
114
|
+
project: z.string().describe('Project directory name under /workspace, e.g. movie-ticket.'),
|
|
115
|
+
output_dir: z.string().describe('Build output directory relative to /workspace/<project>, e.g. dist/build/h5.'),
|
|
116
|
+
node_port: numericArg
|
|
117
|
+
.optional()
|
|
118
|
+
.describe(
|
|
119
|
+
'Node.js app port for SSR proxy. Defaults to the resolved nginx listen port plus one (targetPort + 1) when omitted; the result carries nodePort so you know which port to bind the Node process to.',
|
|
120
|
+
),
|
|
121
|
+
public_port: numericArg.optional().describe('Public listen port for SSR proxy (optional, defaults to port).'),
|
|
122
|
+
config_name: z
|
|
123
|
+
.string()
|
|
124
|
+
.optional()
|
|
125
|
+
.describe(
|
|
126
|
+
'Config file name (without .conf suffix). Defaults to the project name, ensuring each project gets its own config. Override with distinct names (e.g. admin, docs) for sub-app deployments.',
|
|
127
|
+
),
|
|
128
|
+
workspace_id: workspaceId,
|
|
129
|
+
username,
|
|
130
|
+
timeout_ms: numericArg
|
|
131
|
+
.optional()
|
|
132
|
+
.describe(`Execution timeout in milliseconds (default: ${SANDBOX_TIMEOUT_MS.deploy_nginx})`),
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
export const deployCheckSchema = z.looseObject({
|
|
136
|
+
port: numericArg.describe('App listen port (from framework detection).'),
|
|
137
|
+
project: z.string().describe('Project directory name under /workspace.'),
|
|
138
|
+
output_dir: z.string().describe('Build output directory relative to /workspace/<project>, e.g. dist/build/h5.'),
|
|
139
|
+
framework_type: z
|
|
140
|
+
.enum(['spa', 'ssr', 'ssg', 'cross-platform', 'monorepo', 'static'])
|
|
141
|
+
.optional()
|
|
142
|
+
.describe('Framework type from detect_framework. Set to cross-platform for QR code check.'),
|
|
143
|
+
workspace_id: workspaceId,
|
|
144
|
+
username,
|
|
145
|
+
timeout_ms: numericArg
|
|
146
|
+
.optional()
|
|
147
|
+
.describe(`Execution timeout in milliseconds (default: ${SANDBOX_TIMEOUT_MS.deploy_check})`),
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
export const checkUserSchema = z.looseObject({});
|
|
151
|
+
|
|
152
|
+
export const exposeTunnelSchema = z.looseObject({
|
|
153
|
+
port: numericArg.describe(
|
|
154
|
+
'Port nginx actually serves on — use the "port" value returned by huaweicloud_sandbox_deploy_nginx, not the originally requested port.',
|
|
155
|
+
),
|
|
156
|
+
expiry_hours: numericArg
|
|
157
|
+
.optional()
|
|
158
|
+
.describe(
|
|
159
|
+
'Tunnel lifetime in hours, 1-720 (default 72). 720 = the devbridge 30-day maximum; the keepalive watchdog renews to 720h daily.',
|
|
160
|
+
),
|
|
161
|
+
keepalive: z
|
|
162
|
+
.boolean()
|
|
163
|
+
.optional()
|
|
164
|
+
.describe(
|
|
165
|
+
'Enroll the tunnel into the keepalive watchdog (default true — pass false to opt out). Returns keepalive.enrolled/tunnelCount/watchdogPid.',
|
|
166
|
+
),
|
|
167
|
+
workspace_id: workspaceId,
|
|
168
|
+
username,
|
|
169
|
+
timeout_ms: numericArg
|
|
170
|
+
.optional()
|
|
171
|
+
.describe(`Execution timeout in milliseconds (default: ${SANDBOX_TIMEOUT_MS.expose_tunnel})`),
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
export const renewTunnelSchema = z.looseObject({
|
|
175
|
+
tunnel_id: z
|
|
176
|
+
.string()
|
|
177
|
+
.describe(
|
|
178
|
+
"DevBridge tunnel ID to renew (from expose_tunnel's tunnelId field, or extract from the URL https://<tunnel_id>-<port>.devbridge-s2.hwtunnel.com).",
|
|
179
|
+
),
|
|
180
|
+
expiry_hours: numericArg
|
|
181
|
+
.optional()
|
|
182
|
+
.describe(
|
|
183
|
+
'New lifetime in hours, 1-720 (default 720 = the 30-day maximum). Renewal is a rolling window — the same URL stays alive.',
|
|
184
|
+
),
|
|
185
|
+
workspace_id: workspaceId,
|
|
186
|
+
username,
|
|
187
|
+
timeout_ms: numericArg
|
|
188
|
+
.optional()
|
|
189
|
+
.describe(`Execution timeout in milliseconds (default: ${SANDBOX_TIMEOUT_MS.renew_tunnel})`),
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
export const keepaliveWatchdogSchema = z.looseObject({
|
|
193
|
+
tunnels: z
|
|
194
|
+
.array(
|
|
195
|
+
z.looseObject({
|
|
196
|
+
tunnel_id: z
|
|
197
|
+
.string()
|
|
198
|
+
.describe('DevBridge tunnel ID (from expose_tunnel or the URL); a camelCase tunnelId key is also accepted.'),
|
|
199
|
+
url: z.string().describe("The tunnel's public URL (from expose_tunnel's publicUrl)."),
|
|
200
|
+
}),
|
|
201
|
+
)
|
|
202
|
+
.min(1)
|
|
203
|
+
.describe(
|
|
204
|
+
'Tunnels for the watchdog to protect: {tunnel_id, url}. Replaces the current list (expose_tunnel MERGES; this tool sets).',
|
|
205
|
+
),
|
|
206
|
+
workspace_id: workspaceId,
|
|
207
|
+
username,
|
|
208
|
+
timeout_ms: numericArg
|
|
209
|
+
.optional()
|
|
210
|
+
.describe(`Execution timeout in milliseconds (default: ${SANDBOX_TIMEOUT_MS.keepalive_watchdog})`),
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
export const signAgreementSchema = z.looseObject({});
|
|
214
|
+
|
|
215
|
+
export const connectSchema = z.looseObject({
|
|
216
|
+
vendorConfirmed,
|
|
217
|
+
source: z
|
|
218
|
+
.string()
|
|
219
|
+
.optional()
|
|
220
|
+
.describe('Source identifier (default: WEB). Options: VSCODE, CLI, WEB, WEBVNC, WEBPTY, WEBIDE, CURSOR, etc.'),
|
|
221
|
+
pool_type: z
|
|
222
|
+
.enum(['ephemeral', 'persistent'])
|
|
223
|
+
.optional()
|
|
224
|
+
.describe(
|
|
225
|
+
'Sandbox pool type (default ephemeral). ephemeral = non-persistent: idle auto-shutdown 30min + auto-delete 1h (platform scheduled task, verified) — save important data elsewhere; persistent = data disk retained, idle reclaim within 7 days. Each user may hold one instance per pool type (1+1). Explicit template_id overrides pool_type.',
|
|
226
|
+
),
|
|
227
|
+
template_id: z.string().optional().describe('Template ID; overrides server default (only for new sandbox)'),
|
|
228
|
+
flavor_id: z.string().optional().describe('Flavor ID; overrides server default (only for new sandbox)'),
|
|
229
|
+
env: looseObject.optional().describe('Environment variables to set in the sandbox (only for new sandbox)'),
|
|
230
|
+
git: gitConfig.optional().describe('Git repo config (only for new sandbox)'),
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
export const credentialsSchema = z.looseObject({
|
|
234
|
+
session_id: z.string().optional().describe('Session ID from huaweicloud_sandbox_connect'),
|
|
235
|
+
dev_stage_id: z.string().optional().describe('DevStation environment ID (alternative to session_id)'),
|
|
236
|
+
enable_sts: z.boolean().optional().describe('Whether to enable STS temporary AK/SK (default: true)'),
|
|
237
|
+
region: z
|
|
238
|
+
.string()
|
|
239
|
+
.optional()
|
|
240
|
+
.describe(
|
|
241
|
+
'Region used for IAM credential validation and project_id resolution (defaults to the configured region)',
|
|
242
|
+
),
|
|
243
|
+
api_key: z
|
|
244
|
+
.string()
|
|
245
|
+
.optional()
|
|
246
|
+
.describe(
|
|
247
|
+
'DevBridge API Key (devbridge_...), injected into the sandbox as HW_API_KEY for devbridge 0.2.x auth. Also accepts a vault ref (secret://<scope>/<name>), resolved locally so the key never enters the conversation. The local HW_API_KEY environment variable takes precedence over this param (preferred delivery — keeps the long-lived key out of the conversation). Users create one at https://devstation.connect.huaweicloud.com/space/devbridge/apikey (full value shown once at creation). Required for exposing web apps via devbridge 0.2.x; if missing, guide the user through creating one.',
|
|
248
|
+
),
|
|
249
|
+
});
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import {
|
|
2
|
+
execWithSessionSchema,
|
|
3
|
+
execOneShotSchema,
|
|
4
|
+
closeSessionSchema,
|
|
5
|
+
uploadFileSchema,
|
|
6
|
+
uploadProjectSchema,
|
|
7
|
+
deployNginxSchema,
|
|
8
|
+
deployCheckSchema,
|
|
9
|
+
checkUserSchema,
|
|
10
|
+
exposeTunnelSchema,
|
|
11
|
+
renewTunnelSchema,
|
|
12
|
+
keepaliveWatchdogSchema,
|
|
13
|
+
signAgreementSchema,
|
|
14
|
+
connectSchema,
|
|
15
|
+
credentialsSchema,
|
|
16
|
+
} from './schemas.ts';
|
|
17
|
+
import { handleExecWithSession, handleExecOneShot, handleCloseSession } from './handlers-session.ts';
|
|
18
|
+
import { handleUploadFile, handleUploadProject } from './handlers-upload.ts';
|
|
19
|
+
import { handleDeployNginx, handleDeployCheck } from './handlers-deploy.ts';
|
|
20
|
+
import { handleExposeTunnel, handleRenewTunnel, handleKeepaliveWatchdog } from './handlers-tunnel.ts';
|
|
21
|
+
import { handleCheckUser, handleSignAgreement, handleConnect } from './handlers-account.ts';
|
|
22
|
+
import { handleCredentials } from './handlers-credentials.ts';
|
|
23
|
+
import type { PackToolDefinition, LooseToolSchema } from '../../lib/pack-types.ts';
|
|
24
|
+
|
|
25
|
+
// The sandbox pack's stable face (split from the former 879-line monolith
|
|
26
|
+
// for the jscpd complex-file bar, cx < 50 per file; the safety-policy.ts
|
|
27
|
+
// precedent — same exported names, same import path, same behavior). It
|
|
28
|
+
// holds the SANDBOX_TOOLS / SANDBOX_TOOL_SCHEMAS / SANDBOX_TOOL_HANDLERS
|
|
29
|
+
// arrays and their satisfies compile-time completeness checks, and
|
|
30
|
+
// re-exports SANDBOX_TIMEOUT_MS; registry.ts, pack.ts, tool-definitions.ts,
|
|
31
|
+
// tool-schemas.ts, and the tests keep importing exactly these names from
|
|
32
|
+
// here. The family behind it (all siblings inside src/packs/sandbox/,
|
|
33
|
+
// joining the pack-boundaries walk automatically): schemas.ts (the zod
|
|
34
|
+
// schema block + the timeout table), git-transfer.ts (the repo transfer
|
|
35
|
+
// trio), handlers-session.ts / handlers-upload.ts / handlers-deploy.ts /
|
|
36
|
+
// handlers-tunnel.ts / handlers-account.ts / handlers-credentials.ts (the
|
|
37
|
+
// tool handlers, migrated verbatim from src/tools.ts with the P2 pack
|
|
38
|
+
// program).
|
|
39
|
+
|
|
40
|
+
export { SANDBOX_TIMEOUT_MS } from './schemas.ts';
|
|
41
|
+
|
|
42
|
+
export const SANDBOX_TOOLS = [
|
|
43
|
+
{
|
|
44
|
+
name: 'huaweicloud_sandbox_exec_with_session',
|
|
45
|
+
description:
|
|
46
|
+
'Execute a command on a workspace terminal with session reuse (state persists across calls). Shell state (cd, env vars, aliases) carries over between calls. Use for interactive work and command sequences that need shared state. NOT for long-running commands (>30s) — prefer exec_one_shot for those.',
|
|
47
|
+
schema: execWithSessionSchema,
|
|
48
|
+
handler: handleExecWithSession,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'huaweicloud_sandbox_exec_one_shot',
|
|
52
|
+
description:
|
|
53
|
+
'Execute a command on a workspace terminal with a fresh connection per call (no session state carries over). Each invocation opens a new WebSocket connection, executes one command, then disconnects. Use for long-running build/deploy/install commands (>30s) that do not need shell state persistence between calls. More stable than session-based execution for heavy workloads.',
|
|
54
|
+
schema: execOneShotSchema,
|
|
55
|
+
handler: handleExecOneShot,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: 'huaweicloud_sandbox_close_session',
|
|
59
|
+
description:
|
|
60
|
+
'Close the persistent terminal session for a workspace. This closes the agent-side terminal session only — it does NOT delete the sandbox instance. Resource-pool sandbox deletion is developer-initiated (always ask for a second confirmation before guiding a delete) or handled by the platform resource-group idle-reclaim policy within the 7-day cap (v3 caliber); devkit never defers or performs deletion on the user behalf.',
|
|
61
|
+
schema: closeSessionSchema,
|
|
62
|
+
handler: handleCloseSession,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'huaweicloud_sandbox_upload_file',
|
|
66
|
+
description:
|
|
67
|
+
'Upload a local file into the sandbox workspace. Base64-encodes the file, writes it in small chunks through the terminal session (the exec channel is fragile for large single commands), then decodes and verifies the md5 checksum. The remote parent directory is created automatically if absent. Use this instead of embedding large file content directly in a command. local_path must be readable from the machine running the DevKit MCP server — if the file lives elsewhere, copy it to the local temp directory first.',
|
|
68
|
+
schema: uploadFileSchema,
|
|
69
|
+
handler: handleUploadFile,
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'huaweicloud_sandbox_upload_project',
|
|
73
|
+
description:
|
|
74
|
+
'Package a local project directory and upload it to a sandbox workspace via HTTP tunnel. Creates a tar.gz archive, uploads it, and extracts it on the sandbox by default. local_dir must be readable from the machine running the DevKit MCP server — if the project lives elsewhere, copy it to the local temp directory first.',
|
|
75
|
+
schema: uploadProjectSchema,
|
|
76
|
+
handler: handleUploadProject,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'huaweicloud_sandbox_deploy_nginx',
|
|
80
|
+
description:
|
|
81
|
+
'Deploy an nginx configuration on the sandbox and reload. Takes nginxType, port, project, outputDir from framework detection and writes the correct template (SPA try_files, SSR reverse proxy, or static). Also fixes directory traverse permissions on the project path. Use this instead of manually constructing nginx config — it handles permissions, template selection, and reload in one call. If the requested port is already in use, the actual port is auto-incremented and returned in "port" alongside a warning.',
|
|
82
|
+
schema: deployNginxSchema,
|
|
83
|
+
handler: handleDeployNginx,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: 'huaweicloud_sandbox_deploy_check',
|
|
87
|
+
description:
|
|
88
|
+
'Run a deployment completeness check on the sandbox. Verifies nginx is serving, output directory exists, DevBridge tunnel is active and accessible, and QR code exists (cross-platform). Returns a score, nextStep, and (when the DevBridge tunnel is missing) an executable "remediation" command string. Call this at the end of a deployment workflow to confirm everything is working before reporting success.',
|
|
89
|
+
schema: deployCheckSchema,
|
|
90
|
+
handler: handleDeployCheck,
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'huaweicloud_sandbox_expose_tunnel',
|
|
94
|
+
description:
|
|
95
|
+
'Expose a port on the sandbox to a public DevBridge tunnel URL (devbridge 0.2.x). Authenticates automatically (DevBridge auth is fixed to API Key — AK/SK login removed: the waterfall reads the sandbox keyring, then the /tmp/hw_api_key file channel; when both are empty it auto-creates the per-account × per-pool key (devkit-ephemeral/devkit-persistent) via the DevStation relay API and injects it, reporting authMode API_KEY_AUTO), pre-cleans stale tunnels to avoid quota errors, starts the host detached from the exec session (setsid/nohup/disown so it survives session teardown), extracts the public URL (https://<id>-<port>.devbridge-s2.hwtunnel.com), and health-checks it before returning. Use the ACTUAL port reported by huaweicloud_sandbox_deploy_nginx (its "port" field auto-increments on conflict) — never the originally requested port. This automates the manual "Expose the deployed app" flow (huawei-sandbox skill). Returns ok, publicUrl, port, tunnelId, authMode, expiresAt (expiry_hours lifetime, default 72h; 1-720), keepalive.enrolled/tunnelCount/watchdogPid, warnings, sandboxLifetime and urlLifetimeHint. The urlLifetimeHint MUST be relayed to the developer together with the URL: the tunnel expiry is NOT the sandbox lifetime — an idle sandbox shuts down (ephemeral also auto-deletes), which kills the URL. AUTO-ENROLLS the tunnel into the keepalive watchdog (unattended renewal + host re-attach + health check; pass keepalive:false to opt out). The URL is re-verified from a second independent exec session: persistent/verifyHttpCode distinguish a session-surviving URL from one that dies with the deploying session, and a non-persistent URL carries a 请勿分享 warning. Gateway-level tunnel errors (404 "tunnel not found" / "port not configured", 502 "bad gateway") are classified by exact body — an app\'s own 404/502 page is never mistaken for them. When no usable URL is reachable after retries it returns ok:false instead of a dead URL. When auto-creation hits the 20-key quota it returns ok:false with error_code HDKIT_DEVBRIDGE_KEY_QUOTA_EXCEEDED, the currentKeys list, and the console cleanup URL; a failed key invalidation self-heals by clearing the cache and recreating before the next probe.',
|
|
96
|
+
schema: exposeTunnelSchema,
|
|
97
|
+
handler: handleExposeTunnel,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'huaweicloud_sandbox_renew_tunnel',
|
|
101
|
+
description:
|
|
102
|
+
"Renew a DevBridge tunnel's lifetime (devbridge update <id> -e <hours>) — a ROLLING window: expiration = now + hours regardless of remaining time, so renewing before expiry keeps the SAME public URL alive indefinitely (the URL is bound to the tunnel ID and never changes). Default 720h = the 30-day maximum. Returns ok, tunnelId, expiresAt (absolute ISO timestamp read back via show -v — a management-plane loss (10002 tunnel not found) is NOT misread as success), renewedForHours. Use the tunnelId from huaweicloud_sandbox_expose_tunnel or extract it from the URL. The keepalive watchdog renews automatically; this tool is the manual/one-off path.",
|
|
103
|
+
schema: renewTunnelSchema,
|
|
104
|
+
handler: handleRenewTunnel,
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'huaweicloud_sandbox_keepalive_watchdog',
|
|
108
|
+
description:
|
|
109
|
+
'Install or replace the 3-layer keepalive watchdog for a set of tunnels (the tunnel-persistence pattern): (1) host re-attach — restarts `devbridge host <id>` when the host process dies (URL unchanged); (2) daily renewal — `update <id> -e 720` (29-day failure tolerance); (3) health check — curls each URL every 5 minutes and logs WARN on non-200/304. URLs are hardcoded per tunnel (never derived from port-list output — OSC escapes make those greps fail silently). Replaces the current watchdog (expose_tunnel MERGES into it; this tool SETS the list). Returns ok, scriptPath, logPath, watchdogPid, tunnels. The watchdog lives at /tmp/tunnel-keepalive.sh — cleared on reboot (the tunnel LIST dies with it): re-run this tool with the full list after a reboot (a re-expose enrolls only its own NEW tunnel).',
|
|
110
|
+
schema: keepaliveWatchdogSchema,
|
|
111
|
+
handler: handleKeepaliveWatchdog,
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: 'huaweicloud_sandbox_check_user',
|
|
115
|
+
description:
|
|
116
|
+
'Check if the current user has completed real-name verification and signed the required agreements. Returns 200 {realnameVerified, agreementSigned} when all good; throws 403 HDKIT_NOT_REALNAME / HDKIT_NOT_AGREEMENT / HDKIT_NOT_REALNAME_AND_AGREEMENT to indicate what is missing. Never signs anything itself.',
|
|
117
|
+
schema: checkUserSchema,
|
|
118
|
+
handler: handleCheckUser,
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'huaweicloud_sandbox_sign_agreement',
|
|
122
|
+
description:
|
|
123
|
+
"Sign all unsigned or outdated agreements for the current user. Required before huaweicloud_sandbox_connect if check-user returns agreementSigned=false. CRITICAL: only call after the user explicitly consents to signing — never sign agreements on the user's behalf without their explicit request.",
|
|
124
|
+
schema: signAgreementSchema,
|
|
125
|
+
handler: handleSignAgreement,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'huaweicloud_sandbox_connect',
|
|
129
|
+
description:
|
|
130
|
+
'Connect to a sandbox via hdkitservice. One instance per user per pool — reuses the same-pool sandbox if available, otherwise creates a new one. Quota: 1 instance per pool type (a user may hold 1 ephemeral AND 1 persistent simultaneously; same-type requests reuse the existing instance). On quota exhaustion the API returns HTTP 429 with a Retry-After header and a dual error code: HDKIT_QUOTA_EXCEEDED (retry useless — release or reuse the existing instance) vs HDKIT_CAPACITY_INSUFFICIENT (pool capacity; retry later / off-peak). Returns session_id, dev_stage_id, connection_id, connection_address, expiresAt (STS credential expiry), pool_type/template_id echo, server-configured lifecycle numbers (pool_idle_shutdown_minutes / pool_idle_delete_minutes / pool_reclaim_minutes) and started (true when a reused instance was woken from shutdown). Lifecycle hints are announced only on the first connect of a session or when started=true. Ephemeral pool (default): idle auto-shutdown after 30min, auto-delete after 1h — do not keep important data there. Persistent pool: data disk retained (EVS 32G), idle shutdown after 1h, idle reclaim capped at 7 days. Numbers are configured by hdkitservice; the text follows the server echo and falls back to these defaults. Vendor-gated (vendorConfirmed): call only when the vendor is established — see the vendorConfirmed parameter description; when unknown, ask which cloud the user means first.',
|
|
131
|
+
schema: connectSchema,
|
|
132
|
+
handler: handleConnect,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'huaweicloud_sandbox_credentials',
|
|
136
|
+
description:
|
|
137
|
+
'Configure temporary AK/SK for a sandbox via hdkitservice. Validates the current AK/SK against IAM before injecting (invalid SK is rejected here instead of failing later with APIGW.0301 during exec), then injects temporary credentials into the sandbox. Also injects an optional DevBridge API Key — required for devbridge 0.2.x tunnel exposure because 0.2.x removed AK/SK login. The API Key is a long-lived account-level credential, so it is stored in a separate file (/tmp/hw_api_key, 0600) from the temporary AK/SK (/tmp/hw_creds.sh). Source of truth: local HW_API_KEY env first, then the api_key param. The sandbox must be in RUNNING state.',
|
|
138
|
+
schema: credentialsSchema,
|
|
139
|
+
handler: handleCredentials,
|
|
140
|
+
},
|
|
141
|
+
] as const satisfies readonly PackToolDefinition[];
|
|
142
|
+
|
|
143
|
+
export type SandboxToolName = (typeof SANDBOX_TOOLS)[number]['name'];
|
|
144
|
+
|
|
145
|
+
// Schema map keyed by tool name for src/tool-schemas.ts: TOOL_SCHEMAS spreads
|
|
146
|
+
// it in place, keeping the satisfies Record<ToolName, LooseToolSchema>
|
|
147
|
+
// completeness check over every ToolName key.
|
|
148
|
+
export const SANDBOX_TOOL_SCHEMAS: Readonly<Record<SandboxToolName, LooseToolSchema>> = {
|
|
149
|
+
huaweicloud_sandbox_exec_with_session: execWithSessionSchema,
|
|
150
|
+
huaweicloud_sandbox_exec_one_shot: execOneShotSchema,
|
|
151
|
+
huaweicloud_sandbox_close_session: closeSessionSchema,
|
|
152
|
+
huaweicloud_sandbox_upload_file: uploadFileSchema,
|
|
153
|
+
huaweicloud_sandbox_upload_project: uploadProjectSchema,
|
|
154
|
+
huaweicloud_sandbox_deploy_nginx: deployNginxSchema,
|
|
155
|
+
huaweicloud_sandbox_deploy_check: deployCheckSchema,
|
|
156
|
+
huaweicloud_sandbox_expose_tunnel: exposeTunnelSchema,
|
|
157
|
+
huaweicloud_sandbox_renew_tunnel: renewTunnelSchema,
|
|
158
|
+
huaweicloud_sandbox_keepalive_watchdog: keepaliveWatchdogSchema,
|
|
159
|
+
huaweicloud_sandbox_check_user: checkUserSchema,
|
|
160
|
+
huaweicloud_sandbox_sign_agreement: signAgreementSchema,
|
|
161
|
+
huaweicloud_sandbox_connect: connectSchema,
|
|
162
|
+
huaweicloud_sandbox_credentials: credentialsSchema,
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// Dispatch map merged into PACK_TOOL_HANDLERS in packs/registry.ts. Typed over
|
|
166
|
+
// SandboxToolName, so a tool added to SANDBOX_TOOLS without a handler entry
|
|
167
|
+
// here — or the reverse — fails to compile instead of failing at runtime.
|
|
168
|
+
export const SANDBOX_TOOL_HANDLERS: Readonly<Record<SandboxToolName, PackToolDefinition['handler']>> = {
|
|
169
|
+
huaweicloud_sandbox_exec_with_session: handleExecWithSession,
|
|
170
|
+
huaweicloud_sandbox_exec_one_shot: handleExecOneShot,
|
|
171
|
+
huaweicloud_sandbox_close_session: handleCloseSession,
|
|
172
|
+
huaweicloud_sandbox_upload_file: handleUploadFile,
|
|
173
|
+
huaweicloud_sandbox_upload_project: handleUploadProject,
|
|
174
|
+
huaweicloud_sandbox_deploy_nginx: handleDeployNginx,
|
|
175
|
+
huaweicloud_sandbox_deploy_check: handleDeployCheck,
|
|
176
|
+
huaweicloud_sandbox_expose_tunnel: handleExposeTunnel,
|
|
177
|
+
huaweicloud_sandbox_renew_tunnel: handleRenewTunnel,
|
|
178
|
+
huaweicloud_sandbox_keepalive_watchdog: handleKeepaliveWatchdog,
|
|
179
|
+
huaweicloud_sandbox_check_user: handleCheckUser,
|
|
180
|
+
huaweicloud_sandbox_sign_agreement: handleSignAgreement,
|
|
181
|
+
huaweicloud_sandbox_connect: handleConnect,
|
|
182
|
+
huaweicloud_sandbox_credentials: handleCredentials,
|
|
183
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Pack } from '../../lib/pack-types.ts';
|
|
2
|
+
import { SECRETS_TOOLS } from './tools.ts';
|
|
3
|
+
|
|
4
|
+
export const secretsPack: Pack = {
|
|
5
|
+
id: 'secrets',
|
|
6
|
+
title: 'Secrets',
|
|
7
|
+
description:
|
|
8
|
+
'Local encrypted secret vault: store, list, and delete secret:// refs. Values never cross the MCP face; consumption happens through the CLI (secret exec) or the credential resolver.',
|
|
9
|
+
skills: [],
|
|
10
|
+
tools: SECRETS_TOOLS.map((tool) => tool.name),
|
|
11
|
+
};
|