huaweicloud-devkit 1.1.14-next.2 → 2.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -17
- package/README.zh-CN.md +16 -17
- 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 +142 -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 +192 -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/approvals-cli.js +159 -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 +320 -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 +110 -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 +353 -0
- package/plugins/huaweicloud-core/dist/lib/approvals-pin.js +128 -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 +62222 -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 +453 -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 +75 -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 +1045 -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 +76 -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 +1350 -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 +147 -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 +101 -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 +2519 -33
- package/plugins/huaweicloud-core/openclaw.plugin.json +2 -2
- package/plugins/huaweicloud-core/safety/policy.json +53 -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 +100 -93
- 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 +7 -5
- 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 +10 -12
- package/plugins/huaweicloud-core/skills/huaweicloud-core/SKILL.md +38 -37
- 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 +16 -6
- package/plugins/huaweicloud-core/skills/huaweicloud-safety/references/approvals.md +47 -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 +163 -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 +197 -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/approvals-cli.ts +187 -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 +383 -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 +154 -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 +496 -0
- package/plugins/huaweicloud-core/src/lib/approvals-pin.ts +153 -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/lib/hdkit/hdkitservice-api.ts +255 -0
- 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} +126 -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 +513 -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 +76 -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 +1114 -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 +111 -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 +1570 -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 +152 -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 +130 -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/auto-upgrade-runner.mjs +0 -58
- 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 -118
- package/plugins/huaweicloud-core/src/mcp-server-remote.mjs +0 -108
- package/plugins/huaweicloud-core/src/mcp-server.mjs +0 -233
- 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/hdkitservice-api.mjs +0 -293
- 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 -3211
- package/plugins/huaweicloud-core/src/update-auto.mjs +0 -669
- package/plugins/huaweicloud-core/src/update-check.mjs +0 -607
- package/plugins/huaweicloud-core/src/update-policy.mjs +0 -82
- 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,425 @@
|
|
|
1
|
+
import { existsSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { createHash, createHmac } from 'node:crypto';
|
|
5
|
+
import { z } from 'zod';
|
|
6
|
+
import { readGlobalCredentialsStrict, writeObsConfig, resolveCredentialsWithRuntime } from "../../auth/credentials.js";
|
|
7
|
+
import { runHcloud } from "../../hcloud-cli.js";
|
|
8
|
+
import { fetchWithProxy } from "../../proxy/proxy-agent.js";
|
|
9
|
+
import { asCredentialRecord } from "../../lib/credentials.js";
|
|
10
|
+
import { asRecord } from "../../lib/as-record.js";
|
|
11
|
+
// Handlers migrated verbatim from src/tools.ts. setupObsConfig syncs the
|
|
12
|
+
// global credential vault (or the hcloud profile) into ~/.obsutilconfig;
|
|
13
|
+
// handleObsWebsiteConfig signs OBS REST calls with AWS4 — the recommended
|
|
14
|
+
// website-config path (no XML file juggling) over KooCLI 7.3.12+'s
|
|
15
|
+
// `OBS website -method=put -localfile=<xml>` command (7.2.x had neither).
|
|
16
|
+
// Mirrors the JS `a || b || ''` chain for string fields: the first non-empty
|
|
17
|
+
// string wins, everything else falls through.
|
|
18
|
+
function pickString(...values) {
|
|
19
|
+
for (const value of values) {
|
|
20
|
+
if (typeof value === 'string' && value)
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
return '';
|
|
24
|
+
}
|
|
25
|
+
async function setupObsConfig(profile) {
|
|
26
|
+
// Strict resolved read through the shared seam: a literal secret:// string
|
|
27
|
+
// written into ~/.obsutilconfig would break every obsutil call.
|
|
28
|
+
const strict = readGlobalCredentialsStrict();
|
|
29
|
+
if (!strict.ok) {
|
|
30
|
+
return { ok: false, error: strict.error, nextStep: strict.nextStep };
|
|
31
|
+
}
|
|
32
|
+
const stored = asCredentialRecord(strict.credentials);
|
|
33
|
+
if (stored?.ak && stored?.sk) {
|
|
34
|
+
try {
|
|
35
|
+
const obs = writeObsConfig(stored);
|
|
36
|
+
return {
|
|
37
|
+
ok: true,
|
|
38
|
+
existed: false,
|
|
39
|
+
created: true,
|
|
40
|
+
path: obs.path,
|
|
41
|
+
region: stored.region,
|
|
42
|
+
endpoint: obs.endpoint,
|
|
43
|
+
source: 'global-credentials',
|
|
44
|
+
note: 'OBS credentials synced from the global credential vault. OBS commands (hcloud OBS ls, mb, cp, etc.) should now work.',
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
return {
|
|
49
|
+
ok: false,
|
|
50
|
+
error: error instanceof Error ? error.message : String(error),
|
|
51
|
+
nextStep: 'Run "npx huaweicloud-devkit auth init" to refresh credentials and region.',
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return setupObsConfigFromHcloud(profile);
|
|
56
|
+
}
|
|
57
|
+
async function setupObsConfigFromHcloud(profile) {
|
|
58
|
+
const obsConfigPath = join(homedir(), '.obsutilconfig');
|
|
59
|
+
if (existsSync(obsConfigPath)) {
|
|
60
|
+
return {
|
|
61
|
+
ok: true,
|
|
62
|
+
existed: true,
|
|
63
|
+
path: obsConfigPath,
|
|
64
|
+
note: 'OBS config already exists. Delete ~/.obsutilconfig first if you need to re-sync.',
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const args = ['configure', 'show'];
|
|
68
|
+
if (profile)
|
|
69
|
+
args.push('--cli-profile', String(profile));
|
|
70
|
+
const result = await runHcloud(args, { allowWrites: false, allowCredentialRead: true });
|
|
71
|
+
if (!result.ok) {
|
|
72
|
+
return {
|
|
73
|
+
ok: false,
|
|
74
|
+
error: 'Failed to read hcloud profile.',
|
|
75
|
+
detail: result.error || result.stderr || 'hcloud not installed or not configured',
|
|
76
|
+
nextStep: 'Run "npx huaweicloud-devkit auth init" outside agent chat, then retry.',
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
let accessKeyId;
|
|
80
|
+
let secretAccessKey;
|
|
81
|
+
let region;
|
|
82
|
+
try {
|
|
83
|
+
const parsed = typeof result.stdout === 'string' ? JSON.parse(result.stdout) : result.stdout;
|
|
84
|
+
const cred = asRecord(asRecord(parsed).currentCredential);
|
|
85
|
+
accessKeyId = pickString(cred.accessKeyId, cred.ak, cred.access_key);
|
|
86
|
+
secretAccessKey = pickString(cred.secretAccessKey, cred.sk, cred.secret_key);
|
|
87
|
+
region = pickString(asRecord(parsed).currentRegion, asRecord(parsed).region);
|
|
88
|
+
}
|
|
89
|
+
catch {
|
|
90
|
+
return {
|
|
91
|
+
ok: false,
|
|
92
|
+
error: 'Failed to parse hcloud profile output.',
|
|
93
|
+
detail: 'hcloud configure show returned unexpected format',
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (!accessKeyId || !secretAccessKey) {
|
|
97
|
+
return {
|
|
98
|
+
ok: false,
|
|
99
|
+
error: 'No credentials found in hcloud profile.',
|
|
100
|
+
nextStep: 'Run "npx huaweicloud-devkit auth init" outside agent chat to set up credentials first.',
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
if (!region) {
|
|
104
|
+
return {
|
|
105
|
+
ok: false,
|
|
106
|
+
error: 'No region found in hcloud profile.',
|
|
107
|
+
nextStep: 'Run "npx huaweicloud-devkit auth init" outside agent chat to configure credentials and region.',
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
const endpoint = `https://obs.${region}.myhuaweicloud.com`;
|
|
111
|
+
// Flat key=value format (no [default] section) as written by KooCLI 7.x `hcloud OBS config`.
|
|
112
|
+
const configContent = `endpoint=${endpoint}\nak=${accessKeyId}\nsk=${secretAccessKey}\n`;
|
|
113
|
+
try {
|
|
114
|
+
writeFileSync(obsConfigPath, configContent, { encoding: 'utf8', mode: 0o600 });
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
return {
|
|
118
|
+
ok: false,
|
|
119
|
+
error: 'Failed to write OBS config file.',
|
|
120
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
121
|
+
path: obsConfigPath,
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
return {
|
|
125
|
+
ok: true,
|
|
126
|
+
existed: false,
|
|
127
|
+
created: true,
|
|
128
|
+
path: obsConfigPath,
|
|
129
|
+
region,
|
|
130
|
+
endpoint,
|
|
131
|
+
note: 'OBS credentials synced from hcloud profile. OBS commands (hcloud OBS ls, mb, cp, etc.) should now work.',
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
// Shared preamble for the AWS4-signed bucket-config handlers (website/CORS):
|
|
135
|
+
// credential resolution (with the auth_init pointer) and the bucket endpoint.
|
|
136
|
+
function obsSignedContext(bucket, region, what) {
|
|
137
|
+
// Propagating consumers fold the strict S1 seam (AGENTS.md doctrine): a
|
|
138
|
+
// broken vault ref surfaces with its remediation shape, not a raw throw.
|
|
139
|
+
let creds;
|
|
140
|
+
try {
|
|
141
|
+
creds = asCredentialRecord(resolveCredentialsWithRuntime({}));
|
|
142
|
+
}
|
|
143
|
+
catch (error) {
|
|
144
|
+
throw new Error(`OBS ${what} could not resolve credentials: ${error instanceof Error ? error.message : String(error)}. ` +
|
|
145
|
+
'Fix the S1 credential vault (or re-run huaweicloud_auth_init) and retry.', { cause: error });
|
|
146
|
+
}
|
|
147
|
+
const obsAk = creds?.ak;
|
|
148
|
+
const obsSk = creds?.sk;
|
|
149
|
+
if (!obsAk || !obsSk) {
|
|
150
|
+
throw new Error(`OBS ${what} requires AK/SK credentials. Run huaweicloud_auth_init first.`);
|
|
151
|
+
}
|
|
152
|
+
const signedCreds = { ak: obsAk, sk: obsSk, securityToken: creds?.securityToken };
|
|
153
|
+
const host = `${bucket}.obs.${region}.myhuaweicloud.com`;
|
|
154
|
+
return { signedCreds, host, endpoint: `https://${host}` };
|
|
155
|
+
}
|
|
156
|
+
// ── OBS Static Website Hosting (AWS4 signed REST API) ──
|
|
157
|
+
async function handleObsWebsiteConfig(args, _opts = {}) {
|
|
158
|
+
const { action, bucket, region, indexDocument, errorDocument } = args;
|
|
159
|
+
if (!bucket || !region) {
|
|
160
|
+
throw new Error('bucket and region are required');
|
|
161
|
+
}
|
|
162
|
+
const { signedCreds, endpoint } = obsSignedContext(bucket, region, 'website config');
|
|
163
|
+
if (action === 'get') {
|
|
164
|
+
const res = await obsSignedRequest('GET', endpoint, '/?website', '', signedCreds, region);
|
|
165
|
+
return { ok: res.status === 200, status: res.status, body: res.body };
|
|
166
|
+
}
|
|
167
|
+
if (action === 'delete') {
|
|
168
|
+
const res = await obsSignedRequest('DELETE', endpoint, '/?website', '', signedCreds, region);
|
|
169
|
+
return { ok: res.status === 204, status: res.status };
|
|
170
|
+
}
|
|
171
|
+
if (action === 'set') {
|
|
172
|
+
if (!indexDocument) {
|
|
173
|
+
throw new Error('indexDocument is required for action=set');
|
|
174
|
+
}
|
|
175
|
+
const xmlParts = ['<WebsiteConfiguration>', ` <IndexDocument><Suffix>${indexDocument}</Suffix></IndexDocument>`];
|
|
176
|
+
if (errorDocument) {
|
|
177
|
+
xmlParts.push(` <ErrorDocument><Key>${errorDocument}</Key></ErrorDocument>`);
|
|
178
|
+
}
|
|
179
|
+
xmlParts.push('</WebsiteConfiguration>');
|
|
180
|
+
const body = xmlParts.join('\n');
|
|
181
|
+
const res = await obsSignedRequest('PUT', endpoint, '/?website', body, signedCreds, region);
|
|
182
|
+
const websiteUrl = `http://${bucket}.obs-website.${region}.myhuaweicloud.com`;
|
|
183
|
+
return {
|
|
184
|
+
ok: res.status === 200,
|
|
185
|
+
status: res.status,
|
|
186
|
+
websiteUrl,
|
|
187
|
+
message: res.status === 200
|
|
188
|
+
? `Static website hosting configured. Website URL: ${websiteUrl} (may take ~1 min to propagate)`
|
|
189
|
+
: `Failed to configure website: HTTP ${res.status}`,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
throw new Error(`Unknown action: ${action}. Use set, get, or delete.`);
|
|
193
|
+
}
|
|
194
|
+
// #1003: same-structure extension of handleObsWebsiteConfig — before the
|
|
195
|
+
// 7.3.12 pin there was no CORS MCP path (7.2.x lacked the cors subcommand;
|
|
196
|
+
// 7.3.12 materialized it — the U0 A/B logs hold the live evidence), so agents
|
|
197
|
+
// fell back to installing a Python SDK in the sandbox just to configure CORS.
|
|
198
|
+
// This reuses obsSignedRequest (AWS4, s3 service) against /?cors.
|
|
199
|
+
async function handleObsCorsConfig(args = {}, _opts = {}) {
|
|
200
|
+
const { action, bucket, region, rules } = args;
|
|
201
|
+
if (!bucket || !region) {
|
|
202
|
+
throw new Error('bucket and region are required');
|
|
203
|
+
}
|
|
204
|
+
const { signedCreds, host, endpoint } = obsSignedContext(bucket, region, 'CORS config');
|
|
205
|
+
const preflightHint = 'Verify with an OPTIONS preflight before declaring success: ' +
|
|
206
|
+
`curl -i -X OPTIONS --noproxy '*' 'https://${host}/<object-key>' -H 'Origin: <your-app-origin>' -H 'Access-Control-Request-Method: HEAD' ` +
|
|
207
|
+
'must return HTTP 200 with an Access-Control-Allow-Origin header (200 without CORS headers = config not effective; ' +
|
|
208
|
+
'403 = rule missing the requested method). See the huawei-obs skill common-pitfalls.md p05.';
|
|
209
|
+
if (action === 'get') {
|
|
210
|
+
const res = await obsSignedRequest('GET', endpoint, '/?cors', '', signedCreds, region, 'cors');
|
|
211
|
+
return { ok: res.status === 200, status: res.status, body: res.body, verify: preflightHint };
|
|
212
|
+
}
|
|
213
|
+
if (action === 'delete') {
|
|
214
|
+
const res = await obsSignedRequest('DELETE', endpoint, '/?cors', '', signedCreds, region, 'cors');
|
|
215
|
+
return { ok: res.status === 204, status: res.status };
|
|
216
|
+
}
|
|
217
|
+
if (action === 'set') {
|
|
218
|
+
if (!Array.isArray(rules) || rules.length === 0) {
|
|
219
|
+
throw new Error('rules array is required for action=set (allowedOrigin + allowedMethod, HEAD included)');
|
|
220
|
+
}
|
|
221
|
+
const VALID_METHODS = new Set(['GET', 'PUT', 'POST', 'DELETE', 'HEAD']);
|
|
222
|
+
for (const rule of rules) {
|
|
223
|
+
const allowedOrigin = rule?.allowedOrigin;
|
|
224
|
+
const allowedMethod = rule?.allowedMethod;
|
|
225
|
+
if (typeof allowedOrigin !== 'string' ||
|
|
226
|
+
!allowedOrigin ||
|
|
227
|
+
!Array.isArray(allowedMethod) ||
|
|
228
|
+
allowedMethod.length === 0) {
|
|
229
|
+
throw new Error('each CORS rule needs allowedOrigin and a non-empty allowedMethod array');
|
|
230
|
+
}
|
|
231
|
+
for (const method of allowedMethod) {
|
|
232
|
+
if (typeof method !== 'string' || !VALID_METHODS.has(method)) {
|
|
233
|
+
throw new Error(`allowedMethod entries must be one of GET/PUT/POST/DELETE/HEAD (got ${JSON.stringify(method)})`);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (!allowedMethod.includes('HEAD')) {
|
|
237
|
+
// p01: the BrowserJS SDK's HEAD ?apiversion probe gets swallowed by the
|
|
238
|
+
// browser when HEAD is missing — the exact failure this tool exists to
|
|
239
|
+
// prevent, so reject it at the input boundary instead of at runtime.
|
|
240
|
+
throw new Error("allowedMethod must include 'HEAD' — the BrowserJS SDK sends a HEAD ?apiversion probe before every " +
|
|
241
|
+
'operation, and a CORS rule without HEAD makes the browser swallow it as Network Error (p01).');
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const escapeXml = (s) => String(s).replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"');
|
|
245
|
+
const xmlParts = ['<CORSConfiguration>'];
|
|
246
|
+
for (const rule of rules) {
|
|
247
|
+
xmlParts.push(' <CORSRule>');
|
|
248
|
+
xmlParts.push(` <AllowedOrigin>${escapeXml(rule.allowedOrigin)}</AllowedOrigin>`);
|
|
249
|
+
for (const method of rule.allowedMethod ?? []) {
|
|
250
|
+
xmlParts.push(` <AllowedMethod>${escapeXml(method)}</AllowedMethod>`);
|
|
251
|
+
}
|
|
252
|
+
const headers = rule?.allowedHeader;
|
|
253
|
+
if (headers != null && !Array.isArray(headers)) {
|
|
254
|
+
throw new Error(`allowedHeader must be an array (got ${JSON.stringify(headers)})`);
|
|
255
|
+
}
|
|
256
|
+
for (const header of headers ?? ['*']) {
|
|
257
|
+
xmlParts.push(` <AllowedHeader>${escapeXml(header)}</AllowedHeader>`);
|
|
258
|
+
}
|
|
259
|
+
const maxAge = rule.maxAgeSeconds;
|
|
260
|
+
if (maxAge != null) {
|
|
261
|
+
const n = Number(maxAge);
|
|
262
|
+
if (!Number.isSafeInteger(n) || n < 0) {
|
|
263
|
+
throw new Error(`maxAgeSeconds must be a non-negative integer (got ${JSON.stringify(maxAge)})`);
|
|
264
|
+
}
|
|
265
|
+
xmlParts.push(` <MaxAgeSeconds>${n}</MaxAgeSeconds>`);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
// The documented default (schema description) — omitting the element
|
|
269
|
+
// would leave the preflight cache to browser defaults, not 3000.
|
|
270
|
+
xmlParts.push(' <MaxAgeSeconds>3000</MaxAgeSeconds>');
|
|
271
|
+
}
|
|
272
|
+
xmlParts.push(' </CORSRule>');
|
|
273
|
+
}
|
|
274
|
+
xmlParts.push('</CORSConfiguration>');
|
|
275
|
+
const body = xmlParts.join('\n');
|
|
276
|
+
const res = await obsSignedRequest('PUT', endpoint, '/?cors', body, signedCreds, region, 'cors');
|
|
277
|
+
return {
|
|
278
|
+
ok: res.status === 200,
|
|
279
|
+
status: res.status,
|
|
280
|
+
message: res.status === 200
|
|
281
|
+
? `CORS configured for ${bucket} (${rules.length} rule(s)).`
|
|
282
|
+
: `Failed to configure CORS: HTTP ${res.status}`,
|
|
283
|
+
errorDetail: res.status === 200 ? undefined : res.body.slice(0, 400),
|
|
284
|
+
verify: preflightHint,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
throw new Error(`Unknown action: ${action}. Use set, get, or delete.`);
|
|
288
|
+
}
|
|
289
|
+
async function obsSignedRequest(method, endpoint, pathAndQuery, body,
|
|
290
|
+
// Callers throw unless ak and sk are present, so they are required here.
|
|
291
|
+
creds, region,
|
|
292
|
+
// #1003: the bucket subresource being addressed — 'website' for
|
|
293
|
+
// PUT/GET/DELETE /?website, 'cors' for /?cors. Credential scope uses the
|
|
294
|
+
// s3 service name (OBS is S3-compatible).
|
|
295
|
+
subresource = 'website') {
|
|
296
|
+
const now = new Date();
|
|
297
|
+
const dateStamp = now.toISOString().slice(0, 10).replace(/-/g, '');
|
|
298
|
+
const amzDate = dateStamp + 'T' + now.toISOString().slice(11, 19).replace(/:/g, '') + 'Z';
|
|
299
|
+
const payloadHash = createHash('sha256').update(body).digest('hex');
|
|
300
|
+
const url = new URL(endpoint + pathAndQuery);
|
|
301
|
+
const canonicalUri = '/';
|
|
302
|
+
const canonicalQueryString = `${subresource}=`;
|
|
303
|
+
// SigV4 requires every sent x-amz-* header to be signed — an unsigned
|
|
304
|
+
// x-amz-security-token 403s for STS-credential calls. The header list stays
|
|
305
|
+
// sorted (host, x-amz-content-sha256, x-amz-date, x-amz-security-token).
|
|
306
|
+
const tokenHeader = creds.securityToken ? `x-amz-security-token:${creds.securityToken}\n` : '';
|
|
307
|
+
const canonicalHeaders = `host:${url.host}\n` + `x-amz-content-sha256:${payloadHash}\n` + `x-amz-date:${amzDate}\n` + tokenHeader;
|
|
308
|
+
const signedHeaders = creds.securityToken
|
|
309
|
+
? 'host;x-amz-content-sha256;x-amz-date;x-amz-security-token'
|
|
310
|
+
: 'host;x-amz-content-sha256;x-amz-date';
|
|
311
|
+
const canonicalRequest = [
|
|
312
|
+
method,
|
|
313
|
+
canonicalUri,
|
|
314
|
+
canonicalQueryString,
|
|
315
|
+
canonicalHeaders,
|
|
316
|
+
signedHeaders,
|
|
317
|
+
payloadHash,
|
|
318
|
+
].join('\n');
|
|
319
|
+
const credentialScope = `${dateStamp}/${region}/s3/aws4_request`;
|
|
320
|
+
const stringToSign = [
|
|
321
|
+
'AWS4-HMAC-SHA256',
|
|
322
|
+
amzDate,
|
|
323
|
+
credentialScope,
|
|
324
|
+
createHash('sha256').update(canonicalRequest).digest('hex'),
|
|
325
|
+
].join('\n');
|
|
326
|
+
const kDate = createHmac('sha256', 'AWS4' + creds.sk)
|
|
327
|
+
.update(dateStamp)
|
|
328
|
+
.digest();
|
|
329
|
+
const kRegion = createHmac('sha256', kDate).update(region).digest();
|
|
330
|
+
const kService = createHmac('sha256', kRegion).update('s3').digest();
|
|
331
|
+
const kSigning = createHmac('sha256', kService).update('aws4_request').digest();
|
|
332
|
+
const signature = createHmac('sha256', kSigning).update(stringToSign).digest('hex');
|
|
333
|
+
const authorization = `AWS4-HMAC-SHA256 Credential=${creds.ak}/${credentialScope}, ` +
|
|
334
|
+
`SignedHeaders=${signedHeaders}, Signature=${signature}`;
|
|
335
|
+
const headers = {
|
|
336
|
+
Host: url.host,
|
|
337
|
+
'x-amz-content-sha256': payloadHash,
|
|
338
|
+
'x-amz-date': amzDate,
|
|
339
|
+
Authorization: authorization,
|
|
340
|
+
};
|
|
341
|
+
if (body)
|
|
342
|
+
headers['Content-Type'] = 'application/xml';
|
|
343
|
+
if (creds.securityToken)
|
|
344
|
+
headers['x-amz-security-token'] = creds.securityToken;
|
|
345
|
+
const res = await fetchWithProxy(endpoint + pathAndQuery, {
|
|
346
|
+
method,
|
|
347
|
+
headers,
|
|
348
|
+
body: body || undefined,
|
|
349
|
+
});
|
|
350
|
+
const resBody = await res.text();
|
|
351
|
+
return { status: res.status, body: resBody };
|
|
352
|
+
}
|
|
353
|
+
const setupObsConfigSchema = z.looseObject({
|
|
354
|
+
profile: z.string().optional().describe('Optional KooCLI profile name. Uses the active profile by default.'),
|
|
355
|
+
});
|
|
356
|
+
const obsWebsiteConfigSchema = z.looseObject({
|
|
357
|
+
action: z
|
|
358
|
+
.enum(['set', 'get', 'delete'])
|
|
359
|
+
.describe('操作类型:set=配置静态网站托管,get=查询当前配置,delete=删除配置'),
|
|
360
|
+
bucket: z.string().describe('OBS 桶名称'),
|
|
361
|
+
region: z.string().describe('OBS 桶所在区域,如 cn-north-4'),
|
|
362
|
+
indexDocument: z.string().optional().describe('首页文件名(action=set 时必填),如 index.html'),
|
|
363
|
+
errorDocument: z.string().optional().describe('错误页面文件名(action=set 时可选),如 404.html 或 error.html'),
|
|
364
|
+
});
|
|
365
|
+
const obsCorsConfigSchema = z.looseObject({
|
|
366
|
+
action: z.enum(['set', 'get', 'delete']).describe('操作类型:set=配置 CORS 规则,get=查询当前规则,delete=删除规则'),
|
|
367
|
+
bucket: z.string().describe('OBS 桶名称'),
|
|
368
|
+
region: z.string().describe('OBS 桶所在区域,如 cn-north-4'),
|
|
369
|
+
rules: z
|
|
370
|
+
.array(z.looseObject({
|
|
371
|
+
allowedOrigin: z.string().describe('允许的来源,如 https://your-app.example.com 或 *'),
|
|
372
|
+
allowedMethod: z
|
|
373
|
+
.array(z.string())
|
|
374
|
+
.describe('允许的 HTTP 方法(GET/PUT/POST/DELETE/HEAD,必须含 HEAD — BrowserJS SDK 探测依赖)'),
|
|
375
|
+
allowedHeader: z.array(z.string()).optional().describe('允许的请求头,默认 ["*"]'),
|
|
376
|
+
maxAgeSeconds: z.number().int().min(0).optional().describe('预检结果缓存秒数,默认 3000'),
|
|
377
|
+
}))
|
|
378
|
+
.optional()
|
|
379
|
+
.describe('CORS 规则数组(action=set 时必填);allowedMethod 必须含 HEAD'),
|
|
380
|
+
});
|
|
381
|
+
async function handleSetupObsConfig(args = {}, _opts = {}) {
|
|
382
|
+
return setupObsConfig(args.profile);
|
|
383
|
+
}
|
|
384
|
+
export const OBS_TOOLS = [
|
|
385
|
+
{
|
|
386
|
+
name: 'huaweicloud_setup_obs_config',
|
|
387
|
+
description: 'Synchronize KooCLI credentials to OBS config (~/.obsutilconfig). KooCLI and OBS use separate credential stores — hcloud commands work fine but OBS commands fail with "Please set ak, sk" unless this sync is done. Run this once to enable OBS operations; re-run after changing hcloud credentials.',
|
|
388
|
+
schema: setupObsConfigSchema,
|
|
389
|
+
handler: handleSetupObsConfig,
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
name: 'huaweicloud_obs_set_website_config',
|
|
393
|
+
description: '配置 OBS 桶的静态网站托管(推荐路径:无需手写 XML,此工具内部实现 AWS4 签名调用 OBS REST API,屏蔽签名细节)。支持 set(配置)、get(查询)、delete(删除)三种操作。KooCLI 7.3.12+ 另有 `hcloud OBS website -method=put -localfile=<xml>`(XML 文件方式;7.2.x 无此 CLI 命令)。操作前需确保桶已创建且已设置 public-read ACL。',
|
|
394
|
+
schema: obsWebsiteConfigSchema,
|
|
395
|
+
handler: handleObsWebsiteConfig,
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: 'huaweicloud_obs_set_cors',
|
|
399
|
+
// U0-informed wording: KooCLI 7.3.12 (the pinned version) DOES expose the
|
|
400
|
+
// cors subcommand (live-measured: OBS help cors exit 0, -method=get on a
|
|
401
|
+
// nonexistent bucket returns OBS-side NoSuchBucket) — main's description
|
|
402
|
+
// claimed the CLI lacks it, measured on its 7.2.x sandbox. The tool stays
|
|
403
|
+
// the recommended path (no XML file, no --noproxy traps); the CLI is the
|
|
404
|
+
// scripted alternative for 7.3.12+ environments.
|
|
405
|
+
description: '配置 OBS 桶的 CORS 规则(浏览器直传前置条件;推荐路径:此工具内部实现 AWS4 签名调用 OBS REST API(PUT/GET/DELETE /?cors),无需手写 XML,屏蔽签名细节)。支持 set(配置)、get(查询)、delete(删除)三种操作。allowedMethod 必须含 HEAD(BrowserJS SDK 每次操作前发 HEAD ?apiversion 探测,缺 HEAD 时浏览器吞掉探测请求报 Network Error)。KooCLI 7.3.12+ 另有 `hcloud OBS cors obs://<bucket> -method=put -localfile=<xml>`(XML 文件方式;7.2.x 无此 CLI 命令)。配置成功后用返回体中的 verify 命令做 OPTIONS 预检验证(200 + Access-Control-Allow-Origin 才算成功)。',
|
|
406
|
+
schema: obsCorsConfigSchema,
|
|
407
|
+
handler: handleObsCorsConfig,
|
|
408
|
+
},
|
|
409
|
+
];
|
|
410
|
+
// Schema map keyed by tool name for src/tool-schemas.ts: TOOL_SCHEMAS spreads
|
|
411
|
+
// it in place, keeping the satisfies Record<ToolName, LooseToolSchema>
|
|
412
|
+
// completeness check over every ToolName key.
|
|
413
|
+
export const OBS_TOOL_SCHEMAS = {
|
|
414
|
+
huaweicloud_setup_obs_config: setupObsConfigSchema,
|
|
415
|
+
huaweicloud_obs_set_website_config: obsWebsiteConfigSchema,
|
|
416
|
+
huaweicloud_obs_set_cors: obsCorsConfigSchema,
|
|
417
|
+
};
|
|
418
|
+
// Dispatch map merged into PACK_TOOL_HANDLERS in packs/registry.ts. Typed over
|
|
419
|
+
// ObsToolName, so a tool added to OBS_TOOLS without a handler entry
|
|
420
|
+
// here — or the reverse — fails to compile instead of failing at runtime.
|
|
421
|
+
export const OBS_TOOL_HANDLERS = {
|
|
422
|
+
huaweicloud_setup_obs_config: handleSetupObsConfig,
|
|
423
|
+
huaweicloud_obs_set_website_config: handleObsWebsiteConfig,
|
|
424
|
+
huaweicloud_obs_set_cors: handleObsCorsConfig,
|
|
425
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { updatePack } from "./update/pack.js";
|
|
2
|
+
import { sandboxPack } from "./sandbox/pack.js";
|
|
3
|
+
import { authPack } from "./auth/pack.js";
|
|
4
|
+
import { obsPack } from "./obs/pack.js";
|
|
5
|
+
import { voucherPack } from "./voucher/pack.js";
|
|
6
|
+
import { discoveryPack } from "./discovery/pack.js";
|
|
7
|
+
import { huaweicloudCliPack } from "./huaweicloud-cli/pack.js";
|
|
8
|
+
import { huaweicloudOpenMcpPack } from "./huaweicloud-open-mcp/pack.js";
|
|
9
|
+
import { secretsPack } from "./secrets/pack.js";
|
|
10
|
+
import { UPDATE_TOOL_HANDLERS } from "./update/tools.js";
|
|
11
|
+
import { SANDBOX_TOOL_HANDLERS } from "./sandbox/tools.js";
|
|
12
|
+
import { AUTH_TOOL_HANDLERS } from "./auth/tools.js";
|
|
13
|
+
import { OBS_TOOL_HANDLERS } from "./obs/tools.js";
|
|
14
|
+
import { VOUCHER_TOOL_HANDLERS } from "./voucher/tools.js";
|
|
15
|
+
import { DISCOVERY_TOOL_HANDLERS } from "./discovery/tools.js";
|
|
16
|
+
import { HUAWEICLOUD_OPEN_MCP_TOOL_HANDLERS } from "./huaweicloud-open-mcp/tools.js";
|
|
17
|
+
import { HUAWEICLOUD_CLI_TOOL_HANDLERS } from "./huaweicloud-cli/tools.js";
|
|
18
|
+
import { SECRETS_TOOL_HANDLERS } from "./secrets/tools.js";
|
|
19
|
+
// PackId and the Pack interface live in src/lib/pack-types.ts alongside
|
|
20
|
+
// PackToolDefinition, so packs and the registry share one vocabulary module.
|
|
21
|
+
// PACK_OF is the single source of truth for tool → pack ownership. The
|
|
22
|
+
// satisfies check turns a missing or extra key into a compile error, so this
|
|
23
|
+
// map always covers exactly the TOOL_DEFINITIONS registry.
|
|
24
|
+
export const PACK_OF = {
|
|
25
|
+
huaweicloud_check_cli: 'huaweicloud-cli',
|
|
26
|
+
huaweicloud_plan_cli_command: 'huaweicloud-cli',
|
|
27
|
+
huaweicloud_run_readonly_command: 'huaweicloud-cli',
|
|
28
|
+
huaweicloud_list_operations: 'huaweicloud-cli',
|
|
29
|
+
huaweicloud_run_approved_command: 'huaweicloud-cli',
|
|
30
|
+
huaweicloud_show_profile_redacted: 'huaweicloud-cli',
|
|
31
|
+
huaweicloud_hook_check_command: 'core',
|
|
32
|
+
huaweicloud_hook_check_artifacts: 'core',
|
|
33
|
+
huaweicloud_hook_check_deploy_plan: 'core',
|
|
34
|
+
huaweicloud_service_catalog: 'core',
|
|
35
|
+
huaweicloud_explain_error: 'core',
|
|
36
|
+
huaweicloud_search_docs: 'core',
|
|
37
|
+
huaweicloud_retrieve_skill: 'core',
|
|
38
|
+
huaweicloud_list_regions: 'huaweicloud-cli',
|
|
39
|
+
huaweicloud_get_regional_availability: 'core',
|
|
40
|
+
huaweicloud_list_packs: 'core',
|
|
41
|
+
huaweicloud_pack_info: 'core',
|
|
42
|
+
huaweicloud_list_skills: 'core',
|
|
43
|
+
huaweicloud_packs_configure: 'core',
|
|
44
|
+
huaweicloud_search_marketplace: 'discovery',
|
|
45
|
+
huaweicloud_get_service_icon: 'discovery',
|
|
46
|
+
huaweicloud_detect_framework: 'discovery',
|
|
47
|
+
huaweicloud_setup_obs_config: 'obs',
|
|
48
|
+
huaweicloud_obs_set_website_config: 'obs',
|
|
49
|
+
huaweicloud_obs_set_cors: 'obs',
|
|
50
|
+
huaweicloud_auth_status: 'auth',
|
|
51
|
+
huaweicloud_auth_sync: 'auth',
|
|
52
|
+
huaweicloud_auth_init: 'auth',
|
|
53
|
+
huaweicloud_auth_switch: 'auth',
|
|
54
|
+
huaweicloud_auth_confirm: 'auth',
|
|
55
|
+
huaweicloud_check_account_type: 'auth',
|
|
56
|
+
huaweicloud_sandbox_exec_with_session: 'sandbox',
|
|
57
|
+
huaweicloud_sandbox_exec_one_shot: 'sandbox',
|
|
58
|
+
huaweicloud_sandbox_close_session: 'sandbox',
|
|
59
|
+
huaweicloud_sandbox_upload_file: 'sandbox',
|
|
60
|
+
huaweicloud_sandbox_upload_project: 'sandbox',
|
|
61
|
+
huaweicloud_sandbox_deploy_nginx: 'sandbox',
|
|
62
|
+
huaweicloud_sandbox_deploy_check: 'sandbox',
|
|
63
|
+
huaweicloud_sandbox_expose_tunnel: 'sandbox',
|
|
64
|
+
huaweicloud_sandbox_renew_tunnel: 'sandbox',
|
|
65
|
+
huaweicloud_sandbox_keepalive_watchdog: 'sandbox',
|
|
66
|
+
huaweicloud_sandbox_check_user: 'sandbox',
|
|
67
|
+
huaweicloud_sandbox_sign_agreement: 'sandbox',
|
|
68
|
+
huaweicloud_sandbox_connect: 'sandbox',
|
|
69
|
+
huaweicloud_sandbox_credentials: 'sandbox',
|
|
70
|
+
huaweicloud_voucher_status: 'voucher',
|
|
71
|
+
huaweicloud_voucher_claim: 'voucher',
|
|
72
|
+
huaweicloud_competition_voucher_claim: 'voucher',
|
|
73
|
+
huaweicloud_check_update: 'update',
|
|
74
|
+
huaweicloud_upgrade: 'update',
|
|
75
|
+
huaweicloud_gateway_list_tools: 'huaweicloud-open-mcp',
|
|
76
|
+
huaweicloud_gateway_call: 'huaweicloud-open-mcp',
|
|
77
|
+
huaweicloud_gateway_restart: 'huaweicloud-open-mcp',
|
|
78
|
+
huaweicloud_secret_set: 'secrets',
|
|
79
|
+
huaweicloud_secret_list: 'secrets',
|
|
80
|
+
huaweicloud_secret_delete: 'secrets',
|
|
81
|
+
};
|
|
82
|
+
// Central pack dispatch table: the nine per-pack handler maps merged once
|
|
83
|
+
// (DISCOVERY, OBS, AUTH, SANDBOX, VOUCHER, UPDATE, OPENAPI, HUAWEICLOUD_CLI,
|
|
84
|
+
// SECRETS).
|
|
85
|
+
// The satisfies check closes the loop at compile time — a pack tool that
|
|
86
|
+
// exists in PACK_OF but has no merged handler entry (missing from a pack's
|
|
87
|
+
// X_TOOL_HANDLERS, or a whole pack's spread forgotten here) fails the build
|
|
88
|
+
// instead of failing at call time. Same spread-merge shape as TOOL_SCHEMAS
|
|
89
|
+
// in tool-schemas.ts.
|
|
90
|
+
export const PACK_TOOL_HANDLERS = {
|
|
91
|
+
...DISCOVERY_TOOL_HANDLERS,
|
|
92
|
+
...OBS_TOOL_HANDLERS,
|
|
93
|
+
...AUTH_TOOL_HANDLERS,
|
|
94
|
+
...SANDBOX_TOOL_HANDLERS,
|
|
95
|
+
...VOUCHER_TOOL_HANDLERS,
|
|
96
|
+
...UPDATE_TOOL_HANDLERS,
|
|
97
|
+
...HUAWEICLOUD_OPEN_MCP_TOOL_HANDLERS,
|
|
98
|
+
...HUAWEICLOUD_CLI_TOOL_HANDLERS,
|
|
99
|
+
...SECRETS_TOOL_HANDLERS,
|
|
100
|
+
};
|
|
101
|
+
// Runtime guard over the same table: true exactly for the PackToolName
|
|
102
|
+
// literals. callTool dispatches pack tools through it before the core
|
|
103
|
+
// switch, and the narrowing it provides is what keeps the switch's
|
|
104
|
+
// never-guard honest about covering only the core remainder.
|
|
105
|
+
export function isPackToolName(name) {
|
|
106
|
+
return Object.hasOwn(PACK_TOOL_HANDLERS, name);
|
|
107
|
+
}
|
|
108
|
+
// Per-pack tool lists invert PACK_OF instead of hand-writing name lists, so a
|
|
109
|
+
// pack can never claim an unassigned or non-existent tool.
|
|
110
|
+
function toolsFor(id) {
|
|
111
|
+
return Object.keys(PACK_OF).filter((tool) => PACK_OF[tool] === id);
|
|
112
|
+
}
|
|
113
|
+
// skills are claims over the plugin skills/ directories; the pack tests fail
|
|
114
|
+
// when one is claimed twice, left unclaimed, or removed. Every skill's
|
|
115
|
+
// authoritative source lives in its owning pack's skills/ dir — the six
|
|
116
|
+
// meta-skills in src/packs/core/skills/, the twenty service skills in
|
|
117
|
+
// src/packs/huaweicloud-cli/skills/ — generated into the runtime tree by
|
|
118
|
+
// scripts/sync-skills.mjs.
|
|
119
|
+
export const PACKS = [
|
|
120
|
+
{
|
|
121
|
+
id: 'core',
|
|
122
|
+
title: 'Core',
|
|
123
|
+
description: 'KooCLI command planning and execution, hook risk checks, capability catalog, documentation and skill retrieval, and region discovery for Huawei Cloud agent tasks.',
|
|
124
|
+
skills: [
|
|
125
|
+
'huaweicloud-api-and-sdk',
|
|
126
|
+
'huaweicloud-capability-discovery',
|
|
127
|
+
'huaweicloud-cli-and-auth',
|
|
128
|
+
'huaweicloud-core',
|
|
129
|
+
'huaweicloud-safety',
|
|
130
|
+
'huaweicloud-troubleshooting',
|
|
131
|
+
],
|
|
132
|
+
tools: toolsFor('core'),
|
|
133
|
+
},
|
|
134
|
+
huaweicloudCliPack,
|
|
135
|
+
sandboxPack,
|
|
136
|
+
authPack,
|
|
137
|
+
obsPack,
|
|
138
|
+
voucherPack,
|
|
139
|
+
updatePack,
|
|
140
|
+
discoveryPack,
|
|
141
|
+
huaweicloudOpenMcpPack,
|
|
142
|
+
secretsPack,
|
|
143
|
+
];
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import { tmpdir } from 'node:os';
|
|
3
|
+
import { mkdirSync, rmSync } from 'node:fs';
|
|
4
|
+
import { basename, dirname, join } from 'node:path';
|
|
5
|
+
import { promisify } from 'node:util';
|
|
6
|
+
import { execOneShot, uploadProjectWithSession } from "../../sandbox/session-manager.js";
|
|
7
|
+
// The sandbox pack's git repo transfer chain, extracted verbatim from
|
|
8
|
+
// tools.ts in the within-pack split for the jscpd complex-file bar. Handlers
|
|
9
|
+
// migrated verbatim from src/tools.ts; the chain
|
|
10
|
+
// (isGitAvailable/gitCloneToLocal/transferGitRepo) is sandbox-specific and
|
|
11
|
+
// moved with the connect handler (handlers-account.ts imports it here).
|
|
12
|
+
const execFilePromise = promisify(execFile);
|
|
13
|
+
async function isGitAvailable() {
|
|
14
|
+
try {
|
|
15
|
+
await execFilePromise('git', ['--version'], { timeout: 5000 });
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
async function gitCloneToLocal(repoUrl, branch, targetBasename) {
|
|
23
|
+
const tempRoot = join(tmpdir(), `hw-sandbox-git-${Date.now()}`);
|
|
24
|
+
const cloneDir = join(tempRoot, targetBasename);
|
|
25
|
+
mkdirSync(tempRoot, { recursive: true });
|
|
26
|
+
const args = ['clone', '--depth', '1'];
|
|
27
|
+
if (branch)
|
|
28
|
+
args.push('-b', branch);
|
|
29
|
+
args.push(repoUrl, cloneDir);
|
|
30
|
+
await execFilePromise('git', args, { timeout: 120000 });
|
|
31
|
+
return { cloneDir, tempRoot };
|
|
32
|
+
}
|
|
33
|
+
export async function transferGitRepo(args, devStageId, connectResult) {
|
|
34
|
+
const git = args.git;
|
|
35
|
+
if (!git?.repo_url || !git?.target_path)
|
|
36
|
+
return;
|
|
37
|
+
const { repo_url, repo_branch, target_path } = git;
|
|
38
|
+
try {
|
|
39
|
+
const existsCheck = await execOneShot(devStageId, `test -d "${target_path}/.git" && echo "EXISTS" || echo "NOT_EXISTS"`, 'root', 10000);
|
|
40
|
+
if (String(existsCheck.stdout || '').includes('EXISTS')) {
|
|
41
|
+
connectResult._repoStatus = 'already_exists';
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
/* 检查失败继续 */
|
|
47
|
+
}
|
|
48
|
+
const hasGit = await isGitAvailable();
|
|
49
|
+
if (hasGit) {
|
|
50
|
+
let tempRoot = null;
|
|
51
|
+
try {
|
|
52
|
+
const targetName = basename(target_path);
|
|
53
|
+
const { cloneDir, tempRoot: root } = await gitCloneToLocal(repo_url, repo_branch, targetName);
|
|
54
|
+
tempRoot = root;
|
|
55
|
+
await uploadProjectWithSession(devStageId, cloneDir, dirname(target_path), 'root', 300000, {
|
|
56
|
+
extract: true,
|
|
57
|
+
exclude: ['.git', 'node_modules'],
|
|
58
|
+
});
|
|
59
|
+
connectResult._repoStatus = 'uploaded_from_local';
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
/* 本地方式失败,进入兜底 */
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
if (tempRoot) {
|
|
67
|
+
try {
|
|
68
|
+
rmSync(tempRoot, { recursive: true, force: true });
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
/* 清理失败忽略 */
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const branchFlag = repo_branch ? `-b ${repo_branch}` : '';
|
|
77
|
+
await execOneShot(devStageId, `mkdir -p $(dirname "${target_path}") && git clone --depth 1 ${branchFlag} "${repo_url}" "${target_path}"`, 'root', 120000);
|
|
78
|
+
connectResult._repoStatus = 'cloned_in_sandbox';
|
|
79
|
+
}
|