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,494 @@
|
|
|
1
|
+
// The capability catalog: the pack-registry-facing tool handlers, split out
|
|
2
|
+
// of tools.ts. Owns the intent router (service_catalog), the pack inventory
|
|
3
|
+
// (list_packs / pack_info), session pack configuration (packs_configure),
|
|
4
|
+
// the skill→pack ownership inversion (SKILL_OWNER) the boot guard and the
|
|
5
|
+
// skill-serving handlers cross-check, and the shared pack-refusal helpers.
|
|
6
|
+
// tools.ts dispatches into this module from its core switch; the
|
|
7
|
+
// skill-disclosure family (retrieve_skill / list_skills / search_docs)
|
|
8
|
+
// imports SKILL_OWNER and the refusal helpers from here.
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { TOOL_DEFINITIONS } from "./tool-definitions.js";
|
|
11
|
+
// PACKS feeds the pack inventory and the SKILL_OWNER inversion; enable.ts
|
|
12
|
+
// carries the live enablement set (DEVKIT_PACKS > all packs).
|
|
13
|
+
import { PACKS } from "./packs/registry.js";
|
|
14
|
+
import { resolveEnabledPacks } from "./packs/enable.js";
|
|
15
|
+
import {} from "./lib/pack-types.js";
|
|
16
|
+
import { getToolSchema, SCHEMA_DRIFT_IGNORED_KEYS } from "./tool-schemas.js";
|
|
17
|
+
export function serviceCatalog(intent = '') {
|
|
18
|
+
const it = String(intent).toLowerCase();
|
|
19
|
+
const routeMap = [
|
|
20
|
+
{
|
|
21
|
+
keywords: [
|
|
22
|
+
'ecs',
|
|
23
|
+
'server',
|
|
24
|
+
'vm',
|
|
25
|
+
'instance',
|
|
26
|
+
'compute',
|
|
27
|
+
'flavor',
|
|
28
|
+
'image',
|
|
29
|
+
'弹性云服务器',
|
|
30
|
+
'云服务器',
|
|
31
|
+
'服务器',
|
|
32
|
+
'虚拟机',
|
|
33
|
+
'镜像',
|
|
34
|
+
],
|
|
35
|
+
skills: ['huawei-ecs'],
|
|
36
|
+
services: ['ECS'],
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
keywords: [
|
|
40
|
+
'vpc',
|
|
41
|
+
'subnet',
|
|
42
|
+
'network',
|
|
43
|
+
'security group',
|
|
44
|
+
'eip',
|
|
45
|
+
'nat',
|
|
46
|
+
'vpn',
|
|
47
|
+
'bandwidth',
|
|
48
|
+
'虚拟私有云',
|
|
49
|
+
'子网',
|
|
50
|
+
'网络',
|
|
51
|
+
'安全组',
|
|
52
|
+
'弹性公网IP',
|
|
53
|
+
'NAT网关',
|
|
54
|
+
'VPN网关',
|
|
55
|
+
'带宽',
|
|
56
|
+
],
|
|
57
|
+
skills: ['huawei-vpc'],
|
|
58
|
+
services: ['VPC', 'EIP'],
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
keywords: [
|
|
62
|
+
'obs',
|
|
63
|
+
'bucket',
|
|
64
|
+
'storage',
|
|
65
|
+
'object',
|
|
66
|
+
'static website',
|
|
67
|
+
'static site',
|
|
68
|
+
'hosting',
|
|
69
|
+
'对象存储',
|
|
70
|
+
'存储桶',
|
|
71
|
+
'桶',
|
|
72
|
+
'存储',
|
|
73
|
+
'对象',
|
|
74
|
+
'静态网站',
|
|
75
|
+
'静态托管',
|
|
76
|
+
'cors',
|
|
77
|
+
'CORS',
|
|
78
|
+
'browser direct upload',
|
|
79
|
+
'直传',
|
|
80
|
+
'预签名上传',
|
|
81
|
+
],
|
|
82
|
+
skills: ['huawei-obs'],
|
|
83
|
+
services: ['OBS'],
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
keywords: [
|
|
87
|
+
'functiongraph',
|
|
88
|
+
'serverless',
|
|
89
|
+
'function',
|
|
90
|
+
'lambda',
|
|
91
|
+
'trigger',
|
|
92
|
+
'faas',
|
|
93
|
+
'函数工作流',
|
|
94
|
+
'函数',
|
|
95
|
+
'触发器',
|
|
96
|
+
'无服务器',
|
|
97
|
+
'函数计算',
|
|
98
|
+
],
|
|
99
|
+
skills: ['huawei-functiongraph'],
|
|
100
|
+
services: ['FunctionGraph'],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
keywords: ['cce', 'kubernetes', 'k8s', 'container', 'cluster', 'node pool', 'swr', 'docker', 'image registry'],
|
|
104
|
+
skills: ['huawei-cce'],
|
|
105
|
+
services: ['CCE', 'SWR'],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
keywords: ['apig', 'api gateway', 'publish', 'throttle', 'API网关', '限流'],
|
|
109
|
+
skills: ['huawei-cloud-apig-instance-management'],
|
|
110
|
+
services: ['APIG'],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
keywords: ['rds', 'mysql', 'postgresql', 'database', 'db', '关系型数据库', '数据库'],
|
|
114
|
+
skills: ['huawei-rds'],
|
|
115
|
+
services: ['RDS'],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
keywords: ['gaussdb', 'distributed', 'sharding', 'opengauss', '高斯数据库', '分布式数据库'],
|
|
119
|
+
skills: ['huawei-cloud-gaussdb-instance-management'],
|
|
120
|
+
services: ['GaussDB'],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
keywords: [
|
|
124
|
+
'iam',
|
|
125
|
+
'permission',
|
|
126
|
+
'policy',
|
|
127
|
+
'role',
|
|
128
|
+
'user',
|
|
129
|
+
'ak/sk',
|
|
130
|
+
'access key',
|
|
131
|
+
'agency',
|
|
132
|
+
'身份认证',
|
|
133
|
+
'身份管理',
|
|
134
|
+
'权限',
|
|
135
|
+
'策略',
|
|
136
|
+
'角色',
|
|
137
|
+
'用户',
|
|
138
|
+
'访问密钥',
|
|
139
|
+
'委托',
|
|
140
|
+
'primary account',
|
|
141
|
+
'sub-account',
|
|
142
|
+
'account type',
|
|
143
|
+
'主账号',
|
|
144
|
+
'子账号',
|
|
145
|
+
],
|
|
146
|
+
skills: ['huawei-iam'],
|
|
147
|
+
services: ['IAM'],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
keywords: [
|
|
151
|
+
'dew',
|
|
152
|
+
'secret',
|
|
153
|
+
'kms',
|
|
154
|
+
'encrypt',
|
|
155
|
+
'decrypt',
|
|
156
|
+
'certificate',
|
|
157
|
+
'csms',
|
|
158
|
+
'数据加密服务',
|
|
159
|
+
'密钥管理',
|
|
160
|
+
'密钥',
|
|
161
|
+
'加密',
|
|
162
|
+
'解密',
|
|
163
|
+
'证书',
|
|
164
|
+
'凭据管理',
|
|
165
|
+
],
|
|
166
|
+
skills: ['huawei-cloud-dew-key-management'],
|
|
167
|
+
services: ['CSMS', 'KMS'],
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
keywords: ['modelarts', 'ai', 'model', 'training', 'inference', 'machine learning'],
|
|
171
|
+
skills: ['huawei-modelarts'],
|
|
172
|
+
services: ['ModelArts'],
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
keywords: ['billing', 'cost', 'bill', 'budget', 'expense', 'bss', '计费', '费用', '账单', '预算', '开销'],
|
|
176
|
+
skills: ['huawei-billing'],
|
|
177
|
+
services: ['BSS'],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
keywords: ['waf', 'aad', 'ddos', 'firewall', 'web protection'],
|
|
181
|
+
skills: ['huawei-cloud-waf-aad-rule-management'],
|
|
182
|
+
services: ['WAF', 'AAD'],
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
keywords: ['smn', 'dms', 'notification', 'message', 'kafka', 'rabbitmq', 'rocketmq'],
|
|
186
|
+
skills: ['huawei-cloud-smn-dms-message'],
|
|
187
|
+
services: ['SMN', 'DMS'],
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
keywords: ['ces', 'monitor', 'alarm', 'metric', 'dashboard', 'cloud eye', '监控', '告警', '云监控'],
|
|
191
|
+
skills: ['huawei-cloud-eye'],
|
|
192
|
+
services: ['CES'],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
keywords: ['cts', 'audit', 'trace', 'tracker', '审计', '追踪'],
|
|
196
|
+
skills: ['huawei-cloud-cts-trace-management'],
|
|
197
|
+
services: ['CTS'],
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
keywords: ['cbr', 'backup', 'restore', 'vault', 'snapshot', '备份', '恢复', '快照', '存储库'],
|
|
201
|
+
skills: ['huawei-cbr'],
|
|
202
|
+
services: ['CBR'],
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
keywords: ['deployment', 'deploy', 'ci/cd', 'pipeline', 'release'],
|
|
206
|
+
skills: ['huawei-cloud-deployment-task-management'],
|
|
207
|
+
services: ['CloudDeploy'],
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
keywords: [
|
|
211
|
+
'sandbox',
|
|
212
|
+
'devstation',
|
|
213
|
+
'workspace',
|
|
214
|
+
'terminal',
|
|
215
|
+
'preview',
|
|
216
|
+
'hwlink',
|
|
217
|
+
'website',
|
|
218
|
+
'web app',
|
|
219
|
+
'webapp',
|
|
220
|
+
'hosting',
|
|
221
|
+
'网站',
|
|
222
|
+
'网页',
|
|
223
|
+
'静态',
|
|
224
|
+
],
|
|
225
|
+
skills: ['huawei-sandbox'],
|
|
226
|
+
services: ['Sandbox', 'DevStation'],
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
keywords: [
|
|
230
|
+
'dds',
|
|
231
|
+
'dcs',
|
|
232
|
+
'mongodb',
|
|
233
|
+
'redis',
|
|
234
|
+
'memcached',
|
|
235
|
+
'cache',
|
|
236
|
+
'document db',
|
|
237
|
+
'文档数据库',
|
|
238
|
+
'缓存',
|
|
239
|
+
'内存数据库',
|
|
240
|
+
],
|
|
241
|
+
skills: ['huawei-cloud-dds-dcs-instance-management'],
|
|
242
|
+
services: ['DDS', 'DCS'],
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
keywords: ['elb', 'load balancer', '负载均衡', '弹性负载均衡', '监听器', '证书'],
|
|
246
|
+
skills: ['huawei-vpc'],
|
|
247
|
+
services: ['ELB'],
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
keywords: ['openapi', 'api catalog', 'api explorer', 'rest call', 'open api', '全量目录', '接口目录'],
|
|
251
|
+
skills: ['huawei-openapi'],
|
|
252
|
+
services: [],
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
keywords: ['voucher', 'coupon', 'incentive', 'credit', '领券', '代金券', '优惠券', '激励金', '领取'],
|
|
256
|
+
skills: ['huawei-voucher'],
|
|
257
|
+
services: ['Incentive Voucher'],
|
|
258
|
+
},
|
|
259
|
+
];
|
|
260
|
+
const matched = [];
|
|
261
|
+
const tokens = new Set(it.split(/[\s,./-]+/).filter((t) => t.length > 0));
|
|
262
|
+
const cjk = /[\u4e00-\u9fff]/;
|
|
263
|
+
for (const route of routeMap) {
|
|
264
|
+
// Phrase path (space/CJK/slash-bearing keywords like 'ak/sk' and 'ci/cd'):
|
|
265
|
+
// substring match — the tokenizer splits on '/', so those keywords can
|
|
266
|
+
// never be single tokens. Token path: membership, both sides lowercased
|
|
267
|
+
// so a mixed-case keyword ('ModelArts') stays matchable.
|
|
268
|
+
if (route.keywords.some((kw) => kw.includes(' ') || kw.includes('/') || cjk.test(kw)
|
|
269
|
+
? it.includes(kw.toLowerCase())
|
|
270
|
+
: tokens.has(kw.toLowerCase()))) {
|
|
271
|
+
matched.push(route);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
const recommendedSkills = [...new Set(matched.flatMap((r) => r.skills))];
|
|
275
|
+
// Never recommend a skill whose owning pack is disabled — the router must
|
|
276
|
+
// not send the agent to a loader that will refuse (same filter searchDocs
|
|
277
|
+
// applies to its index).
|
|
278
|
+
const enabled = resolveEnabledPacks();
|
|
279
|
+
const gated = recommendedSkills.filter((skill) => {
|
|
280
|
+
const owner = SKILL_OWNER.get(skill);
|
|
281
|
+
return !owner || enabled.has(owner);
|
|
282
|
+
});
|
|
283
|
+
let recommendedServices = [...new Set(matched.flatMap((r) => r.services))].slice(0, 5);
|
|
284
|
+
// Deployment intent must land on a compute/hosting recommendation, never a
|
|
285
|
+
// bare data-service list or nothing at all (2026-11-05 UX report #1: the
|
|
286
|
+
// intent 部署一个带负载均衡和数据库的 web 应用 recommended ELB+RDS with no
|
|
287
|
+
// compute carrier, and narrower phrasings like 部署 web 应用 matched nothing).
|
|
288
|
+
// The keyword routes stay deliberately narrow — broad 'web 应用'/'webapp'
|
|
289
|
+
// keywords misroute WAF phrasings onto ECS and double-route the sandbox
|
|
290
|
+
// (probe-proven) — so the fallback adds the two hosting targets when the
|
|
291
|
+
// intent is a deploy ACTION.
|
|
292
|
+
//
|
|
293
|
+
// Loop round 5 (seat-3 round-4): the negative classes are an OPEN set, so
|
|
294
|
+
// the gate states its final contract here instead of chasing words: the
|
|
295
|
+
// how-to-TROUBLESHOOT arm covers 怎么/如何 + fix verbs plus 怎么办 (the
|
|
296
|
+
// highest-frequency Chinese ops question) and the English how-to-fix
|
|
297
|
+
// shapes; the query-prefix arm covers the 帮我/请/查 families plus
|
|
298
|
+
// 看看/检索/搜/显示. A compound sentence that QUERY-opens but then carries
|
|
299
|
+
// a real deploy clause (查一下部署日志,然后部署新版本) is exempted from the
|
|
300
|
+
// query block — blocking it landed the round-4 B5 mirror (mixed sentences
|
|
301
|
+
// landing on nothing). Residual approximations, accepted and documented:
|
|
302
|
+
// post-positioned query nouns (部署记录查询), bare ambiguous queries
|
|
303
|
+
// without a deploy verb, and occasional non-action phrasings (发布订阅模式,
|
|
304
|
+
// deployment pipeline, publish the npm package) fire — advisory noise,
|
|
305
|
+
// never the original failure (a deploy sentence without a compute carrier).
|
|
306
|
+
const definitional = /是什么|什么意思|区别|概念|怎么写|在哪|在哪里|多少钱|价格|是多少|\bwhat is\b|\bwhat are\b|\bwhat should i do\b/i;
|
|
307
|
+
const troubleshootHowTo = /怎么办|(?:怎么|如何).{0,6}(?:排查|处理|解决|修复|定位|看|查|验证|检查)|\bhow\s+(?:do\s+i|to|can\s+i|should\s+i)\b[^。;;]{0,24}\b(?:fix|solve|resolve|troubleshoot|debug)\b/i;
|
|
308
|
+
const queryVerbs = /(?:查询|查看|看看|看下|看一下|看一眼|看|瞧瞧|瞧一下|瞧一眼|瞧|瞅瞅|瞅一眼|瞅|瞄一眼|瞄|检索|搜|显示|找|查)/;
|
|
309
|
+
// The politeness-prefix stack is star-joined: prefix chains stack freely
|
|
310
|
+
// in Chinese (麻烦您请帮个忙看下…) and a single-slot alternation let any
|
|
311
|
+
// novel politeness word through (loop rounds 6-7, seat-3 B2).
|
|
312
|
+
const queryPrefix = new RegExp('^(?:请|帮我|帮忙|帮个忙|麻烦|劳驾|拜托|你好|您好|在吗)*' + queryVerbs.source);
|
|
313
|
+
const hostNoun = /\bhost\s*[-\s]*(?:头|header)/i;
|
|
314
|
+
// Loop round 10 (seat-3, structural): the query/deploy judgment is
|
|
315
|
+
// POSITIONAL — a query verb occurring BEFORE the sentence's first
|
|
316
|
+
// deploy-family verb (within 14 chars) reads as a query ABOUT deployment
|
|
317
|
+
// artifacts (帮我看下部署日志/顺便看下部署日志/麻烦了,帮我瞅瞅部署记录);
|
|
318
|
+
// a deploy verb FIRST with a query trailing (先部署网站,再看部署记录/
|
|
319
|
+
// 部署应用,然后查看部署日志) is a deploy action with a query afterthought.
|
|
320
|
+
// The compound exemption only rescues the query-open form whose tail
|
|
321
|
+
// carries a real deploy clause (查一下部署日志,然后部署新版本). The
|
|
322
|
+
// irreducible residual, documented and one-directional: post-positioned
|
|
323
|
+
// query nouns (部署记录查询/托管服务查询/帮我查询部署情况) fire — advisory
|
|
324
|
+
// noise, never the original failure (a deploy sentence landing on nothing).
|
|
325
|
+
const queryVerbRe = new RegExp(queryVerbs.source, 'g');
|
|
326
|
+
const deployVerbRe = /部署|上线|发布|搭建|托管/;
|
|
327
|
+
const firstQuery = it.search(queryVerbRe);
|
|
328
|
+
const firstDeploy = it.search(deployVerbRe);
|
|
329
|
+
const queryBeforeDeploy = firstQuery >= 0 && firstDeploy >= 0 && firstQuery < firstDeploy && firstDeploy - firstQuery <= 14;
|
|
330
|
+
// A query OPEN followed by a comma-separated deploy CLAUSE is an action
|
|
331
|
+
// sentence (查一下部署日志,然后部署新版本). Loop round 12 (FINAL): the
|
|
332
|
+
// negative look-ahead is pinned to the five interrogative words and WILL
|
|
333
|
+
// NOT grow. Rounds 8-11 proved this arm has no fixed point: widening the
|
|
334
|
+
// connector set or the noun-exclusion list flips direction every round
|
|
335
|
+
// (round-8 noun list swallowed the round-4 deploy-object sentence
|
|
336
|
+
// 发布状态页 mirror; round-11 list swallowed it again via 状态/失败). The
|
|
337
|
+
// residual is the documented contract, BOTH directions:
|
|
338
|
+
// - miss (deploy sentence landing on nothing): non-comma connectors
|
|
339
|
+
// (查完部署文档就上线新版本), gaps > 16 chars, tails whose first word
|
|
340
|
+
// is a listed noun — the skills layer's deployment-target doctrine
|
|
341
|
+
// re-catches these;
|
|
342
|
+
// - noise (pure query gaining the compute rec): tails MENTIONING the
|
|
343
|
+
// deploy word (帮我看下部署日志,看看部署失败没有) — advisory noise,
|
|
344
|
+
// never a misroute that provisions.
|
|
345
|
+
const compoundDeployTail = /[,,;;][^,。;;]{0,16}?(?:部署|搭建|上线|发布|托管)(?!\s*(?:是|谁|什么|如何|怎么))/;
|
|
346
|
+
const blocked = definitional.test(it) ||
|
|
347
|
+
troubleshootHowTo.test(it) ||
|
|
348
|
+
((queryPrefix.test(it) || queryBeforeDeploy) && !compoundDeployTail.test(it)) ||
|
|
349
|
+
hostNoun.test(it);
|
|
350
|
+
// Site-artifact build phrasings: create-verb + 网站/网页 ending the
|
|
351
|
+
// sentence ('做个网页'), noun-first how-to ('网站怎么做', '网站想建一个'), and
|
|
352
|
+
// the 把/将 construction ('把网站做出来'). A trailing object after the site
|
|
353
|
+
// noun ('写网站文案') is writing ABOUT a site, not building one. (A regex
|
|
354
|
+
// literal chain `a || b` would collapse to the first always-truthy regex
|
|
355
|
+
// object at declaration — the shapes must be tested, not OR'd as values.)
|
|
356
|
+
const siteBuildZh = (intent) => /(?:做|建|搭|写|开发|制作)[^,。,.]{0,8}(?:网站|网页)[^,。,.]?$/.test(intent) ||
|
|
357
|
+
/(?:网站|网页)[^,。,.]{0,6}怎么(?:做|搭|建|写)/.test(intent) ||
|
|
358
|
+
/(?:网站|网页)[^,。,.]{0,4}(?:建|做|搭)(?:一|一个|出来)?[^,。,.]{0,2}$/.test(intent) ||
|
|
359
|
+
/(?:把|将)(?:网站|网页)[^,。,.]{0,4}(?:做|建|搭)出来/.test(intent);
|
|
360
|
+
const deploymentIntent = !blocked &&
|
|
361
|
+
(/部署|上线|发布|搭建|托管/.test(it) ||
|
|
362
|
+
siteBuildZh(it) ||
|
|
363
|
+
/\b(?:deploy|deployment|deploying|host|hosting|hosted|publish|publishing|preview)\b/i.test(it));
|
|
364
|
+
if (deploymentIntent) {
|
|
365
|
+
const enabledOwner = (skill) => {
|
|
366
|
+
const owner = SKILL_OWNER.get(skill);
|
|
367
|
+
return !owner || enabled.has(owner);
|
|
368
|
+
};
|
|
369
|
+
const fallbacks = ['huawei-sandbox', 'huawei-ecs'].filter((skill) => !gated.includes(skill) && enabledOwner(skill));
|
|
370
|
+
gated.unshift(...fallbacks);
|
|
371
|
+
// The sandbox leads a deployment intent (the pre-existing doctrine the
|
|
372
|
+
// reorder block carried): whatever order the unshift produced, hoist it.
|
|
373
|
+
if (gated.includes('huawei-sandbox')) {
|
|
374
|
+
gated.splice(gated.indexOf('huawei-sandbox'), 1);
|
|
375
|
+
gated.unshift('huawei-sandbox');
|
|
376
|
+
}
|
|
377
|
+
// Matched services keep their positions ahead of the fallback entries —
|
|
378
|
+
// a user-named service never drops out (loop round 2 R7: RDS was evicted
|
|
379
|
+
// when the fallbacks were prepended into a flat 5-slot list). The matched
|
|
380
|
+
// half was already capped at 5 above (the pre-fallback contract for
|
|
381
|
+
// non-deployment intents is unchanged); the two fallback entries ride
|
|
382
|
+
// AFTER it, so both halves survive.
|
|
383
|
+
const serviceFallbacks = fallbacks.map((skill) => (skill === 'huawei-sandbox' ? 'Sandbox' : 'ECS'));
|
|
384
|
+
recommendedServices = [...new Set([...recommendedServices, ...serviceFallbacks])];
|
|
385
|
+
}
|
|
386
|
+
return {
|
|
387
|
+
intent,
|
|
388
|
+
recommendedSkills: gated.length ? gated : ['Use huaweicloud-core to route intent.'],
|
|
389
|
+
recommendedServices: recommendedServices.length
|
|
390
|
+
? recommendedServices.slice(0, 7)
|
|
391
|
+
: ['Run hcloud --help to list available services.'],
|
|
392
|
+
capabilityOrder: [
|
|
393
|
+
'Huawei Cloud Skills for task-specific workflows and examples',
|
|
394
|
+
'KooCLI hcloud for local authenticated operations and quick inspection',
|
|
395
|
+
'Huawei Cloud API documentation for exact request and response contracts',
|
|
396
|
+
'Huawei Cloud SDKs for application code integration',
|
|
397
|
+
'Huawei Cloud MCP when an official or approved server is available',
|
|
398
|
+
'Terraform Provider only when IaC reviewability and repeatability are important',
|
|
399
|
+
],
|
|
400
|
+
ruleOfThumb: {
|
|
401
|
+
skills: 'Start here when the task (already a Huawei Cloud one) is scenario-shaped or needs a guided workflow.',
|
|
402
|
+
cli: 'Use for local diagnostics, read-only inspection, and commands the user can review.',
|
|
403
|
+
api: 'Use for exact service contract, region endpoint, project_id, pagination, and error codes.',
|
|
404
|
+
sdk: 'Use when writing application code that calls Huawei Cloud services.',
|
|
405
|
+
mcp: 'Prefer approved MCP tools when available because tools can carry structured schemas.',
|
|
406
|
+
terraform: 'Keep low priority in V1; suggest it for reviewed infrastructure changes, not quick diagnosis.',
|
|
407
|
+
},
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
// ── Pack meta tools ──
|
|
411
|
+
// Both tools read the pack registry (PACK_OF inversion in packs/registry.ts),
|
|
412
|
+
// the tool definitions (name/description), the zod schemas, and the live
|
|
413
|
+
// enablement set (packs/enable.ts, DEVKIT_PACKS > all packs), so their output
|
|
414
|
+
// can never disagree with tools/list: a disabled pack is listed with
|
|
415
|
+
// enabled:false, and pack_info refuses to detail it.
|
|
416
|
+
// Skill directory → owning pack, inverted from the PACKS claims. The tree is
|
|
417
|
+
// server data, so an unclaimed directory is a retired skill name that
|
|
418
|
+
// survived a copy: copyServerPayload prunes those on update, and treating
|
|
419
|
+
// stragglers as unowned (outside pack gating) is defense in depth — the
|
|
420
|
+
// enablement filter in searchDocs/retrieveSkill never crashes on them.
|
|
421
|
+
export const SKILL_OWNER = new Map(PACKS.flatMap((pack) => pack.skills.map((skill) => [skill, pack.id])));
|
|
422
|
+
export function listPacks(opts = {}) {
|
|
423
|
+
const enabled = resolveEnabledPacks();
|
|
424
|
+
// packs_configure is core-owned but registered only on surfaces that carry
|
|
425
|
+
// session state (stdio). The meta tools must not advertise a tool where
|
|
426
|
+
// tools/list will never carry it, so core's tool list is filtered by the
|
|
427
|
+
// same seam the registration factory uses.
|
|
428
|
+
const runtimeToggling = Boolean(opts.onPacksChanged);
|
|
429
|
+
return {
|
|
430
|
+
ok: true,
|
|
431
|
+
count: PACKS.length,
|
|
432
|
+
packs: PACKS.map((pack) => ({
|
|
433
|
+
id: pack.id,
|
|
434
|
+
title: pack.title,
|
|
435
|
+
description: pack.description,
|
|
436
|
+
skills: pack.skills,
|
|
437
|
+
tools: pack.id === 'core' && !runtimeToggling
|
|
438
|
+
? pack.tools.filter((name) => name !== 'huaweicloud_packs_configure')
|
|
439
|
+
: pack.tools,
|
|
440
|
+
enabled: enabled.has(pack.id),
|
|
441
|
+
})),
|
|
442
|
+
};
|
|
443
|
+
}
|
|
444
|
+
// Shared enablement remediation: pack_info, list_skills, and retrieve_skill
|
|
445
|
+
// serve the same instructions for the same condition, so a wording fix lands
|
|
446
|
+
// once. The stdio qualifier keeps the message honest on the stateless
|
|
447
|
+
// remote, which never registers the session-toggle tool.
|
|
448
|
+
export function packEnablementRemediation(packId) {
|
|
449
|
+
return ('Enable it for this session with huaweicloud_packs_configure (stdio agent sessions; confirm with the user when the operator trimmed the pack on purpose), or ask the operator to persist it with npx huaweicloud-devkit packs enable ' +
|
|
450
|
+
packId +
|
|
451
|
+
' --target <agent>, then restart the agent (that command rewrites DEVKIT_PACKS in the agent MCP config).');
|
|
452
|
+
}
|
|
453
|
+
// Shared refusal for an unknown pack id: names every valid id so the caller
|
|
454
|
+
// can retry without a second discovery call.
|
|
455
|
+
export function packNotFound(packId) {
|
|
456
|
+
const available = PACKS.map((entry) => entry.id).join(', ');
|
|
457
|
+
return { ok: false, error: 'Pack "' + packId + '" not found. Available: ' + available };
|
|
458
|
+
}
|
|
459
|
+
export function packNotEnabled(packId) {
|
|
460
|
+
return { ok: false, error: 'Pack "' + packId + '" is not enabled. ' + packEnablementRemediation(packId) };
|
|
461
|
+
}
|
|
462
|
+
export function packInfo(pack, opts = {}) {
|
|
463
|
+
const packId = String(pack || '').trim();
|
|
464
|
+
if (!packId)
|
|
465
|
+
return { ok: false, error: 'Pack id is required.' };
|
|
466
|
+
const found = PACKS.find((entry) => entry.id === packId);
|
|
467
|
+
if (!found)
|
|
468
|
+
return packNotFound(packId);
|
|
469
|
+
const enabled = resolveEnabledPacks();
|
|
470
|
+
if (!enabled.has(found.id))
|
|
471
|
+
return packNotEnabled(found.id);
|
|
472
|
+
// Same surface filter as listPacks: core owns packs_configure, but only
|
|
473
|
+
// session-carrying surfaces register it, and pack_info must not advertise
|
|
474
|
+
// a tool tools/list will never carry.
|
|
475
|
+
const toolNames = found.id === 'core' && !opts.onPacksChanged
|
|
476
|
+
? found.tools.filter((name) => name !== 'huaweicloud_packs_configure')
|
|
477
|
+
: found.tools;
|
|
478
|
+
const tools = toolNames.map((name) => {
|
|
479
|
+
const definition = TOOL_DEFINITIONS.find((tool) => tool.name === name);
|
|
480
|
+
const schema = z.toJSONSchema(getToolSchema(name));
|
|
481
|
+
for (const key of SCHEMA_DRIFT_IGNORED_KEYS)
|
|
482
|
+
delete schema[key];
|
|
483
|
+
return { name, description: definition?.description ?? '', schema };
|
|
484
|
+
});
|
|
485
|
+
return {
|
|
486
|
+
ok: true,
|
|
487
|
+
pack: found.id,
|
|
488
|
+
title: found.title,
|
|
489
|
+
description: found.description,
|
|
490
|
+
skills: found.skills,
|
|
491
|
+
tools,
|
|
492
|
+
enabled: true,
|
|
493
|
+
};
|
|
494
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
// CodeArts sandbox detection, shared by the doctor output (setup-cli.ts) and
|
|
5
|
+
// the KooCLI installer (dep/installers/hcloud.ts). Extracted from setup-cli.ts
|
|
6
|
+
// when the installer moved: both consumers need the same bash_mode probe and
|
|
7
|
+
// the same remediation text, and a local copy in each would drift.
|
|
8
|
+
// Detect CodeArts sandbox mode (bash_mode in permission config).
|
|
9
|
+
export function detectCodeartsSandbox() {
|
|
10
|
+
try {
|
|
11
|
+
const configPath = join(homedir(), '.codeartsdoer', 'codearts-data', 'storage', 'permission', 'config.json');
|
|
12
|
+
if (!existsSync(configPath))
|
|
13
|
+
return null;
|
|
14
|
+
const parsed = JSON.parse(readFileSync(configPath, 'utf8'));
|
|
15
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed))
|
|
16
|
+
return null;
|
|
17
|
+
const bashMode = parsed.bash_mode;
|
|
18
|
+
return typeof bashMode === 'string' ? bashMode : null;
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
export function printSandboxWarning(reason) {
|
|
25
|
+
console.log(`\n\x1b[1m\x1b[31m⚠ 检测到码道沙箱模式 (bash_mode: sandbox)\x1b[0m`);
|
|
26
|
+
console.log(`\x1b[31m ${reason}\x1b[0m`);
|
|
27
|
+
console.log(`\x1b[31m 请任选其一继续:\x1b[0m`);
|
|
28
|
+
console.log(`\x1b[31m A. 在码道外的终端安装并使用 KooCLI (推荐):`);
|
|
29
|
+
console.log(`\x1b[31m https://support.huaweicloud.com/qs-hcli/hcli_02_003.html`);
|
|
30
|
+
console.log(`\x1b[31m B. 在码道设置中关闭沙箱模式后重试 (设置 → 对话流 → 智能体 终端命令运行模式 → 自动运行)`);
|
|
31
|
+
console.log(`\x1b[31m 关闭沙箱后重新运行: npx huaweicloud-devkit install-hcloud\x1b[0m`);
|
|
32
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { readFileSync } from 'node:fs';
|
|
3
|
+
import { dirname, join, resolve } from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { lookupOnPath } from "./lib/dep-resolve.js";
|
|
6
|
+
import { asRecord } from "./lib/as-record.js";
|
|
7
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const PLUGIN_ROOT = resolve(__dirname, '..');
|
|
9
|
+
const PACKAGE_ROOT = resolve(PLUGIN_ROOT, '..', '..');
|
|
10
|
+
export function getMarketplaceName() {
|
|
11
|
+
const marketplacePath = join(PACKAGE_ROOT, '.agents', 'plugins', 'marketplace.json');
|
|
12
|
+
try {
|
|
13
|
+
const manifest = asRecord(JSON.parse(readFileSync(marketplacePath, 'utf8')));
|
|
14
|
+
if (typeof manifest.name === 'string' && manifest.name)
|
|
15
|
+
return manifest.name;
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
// missing or corrupt marketplace.json means the default marketplace name
|
|
19
|
+
}
|
|
20
|
+
return 'huaweicloud-devkit';
|
|
21
|
+
}
|
|
22
|
+
export function getCodexPluginName() {
|
|
23
|
+
const marketplacePath = join(PACKAGE_ROOT, '.agents', 'plugins', 'marketplace.json');
|
|
24
|
+
try {
|
|
25
|
+
const marketplace = asRecord(JSON.parse(readFileSync(marketplacePath, 'utf8')));
|
|
26
|
+
const plugins = Array.isArray(marketplace.plugins) ? marketplace.plugins : [];
|
|
27
|
+
const pluginName = asRecord(plugins[0]).name;
|
|
28
|
+
if (typeof pluginName === 'string' && pluginName)
|
|
29
|
+
return pluginName;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
// missing or corrupt marketplace.json falls through to the plugin manifest
|
|
33
|
+
}
|
|
34
|
+
const codexManifestPath = join(PLUGIN_ROOT, '.codex-plugin', 'plugin.json');
|
|
35
|
+
try {
|
|
36
|
+
const manifest = asRecord(JSON.parse(readFileSync(codexManifestPath, 'utf8')));
|
|
37
|
+
if (typeof manifest.name === 'string' && manifest.name)
|
|
38
|
+
return manifest.name;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// missing or corrupt plugin manifest means the default plugin name
|
|
42
|
+
}
|
|
43
|
+
return 'huaweicloud-devkit';
|
|
44
|
+
}
|
|
45
|
+
export function codexPluginProbe() {
|
|
46
|
+
if (lookupOnPath('codex', process.env) === null)
|
|
47
|
+
return { ok: true, installed: false };
|
|
48
|
+
// Parse the structured output instead of substring-matching the table: the
|
|
49
|
+
// plugin's SOURCE path (…/plugins/huaweicloud-core) also contains the name,
|
|
50
|
+
// so a naive includes() reports "installed" even when the status column says
|
|
51
|
+
// "not installed".
|
|
52
|
+
const r = spawnSync('codex plugin list --json', [], {
|
|
53
|
+
shell: true,
|
|
54
|
+
windowsHide: true,
|
|
55
|
+
stdio: 'pipe',
|
|
56
|
+
timeout: 5000,
|
|
57
|
+
});
|
|
58
|
+
if (r.status !== 0)
|
|
59
|
+
return { ok: false };
|
|
60
|
+
const out = r.stdout ? r.stdout.toString() : '';
|
|
61
|
+
const name = getCodexPluginName();
|
|
62
|
+
try {
|
|
63
|
+
const data = asRecord(JSON.parse(out));
|
|
64
|
+
if (!Array.isArray(data.installed))
|
|
65
|
+
return { ok: false };
|
|
66
|
+
return {
|
|
67
|
+
ok: true,
|
|
68
|
+
installed: data.installed.some((p) => {
|
|
69
|
+
const record = asRecord(p);
|
|
70
|
+
return record.name === name || (typeof record.pluginId === 'string' && record.pluginId.startsWith(`${name}@`));
|
|
71
|
+
}),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return { ok: false };
|
|
76
|
+
}
|
|
77
|
+
}
|