SuperAPI AI Directory

huawei-cloud-activity-submit

Deployment & operations

View repository

Updated 10-21 03:11

About this skill

Huawei Cloud Open Capability Challenge · Work Submission Skill (Production Environment)

Let the Agent directly call the activity Agent submission API(AK/SK authentication) to complete result submission (without any page/browser operations), and after successful submission, notify the user of the corresponding step points already earned.

Overview

This Skill lets the Agent directly call the Huawei Cloud "Open Capability Challenge" (activity_code = open-capability-2026-1024) 's Agent submission API(AK/SK authentication), automatically submitting the work link generated by the activity to the corresponding step, and reporting the points earned after success.

Core Features:

  • Pure API calls: no page/browser operations involved; directly POST to the submission API.
  • Fixed production environment: this skill always uses the production environment API and does not switch environments.
  • Two-step sequential submission:beginner(sandbox deployment, 1000 points) → intermediate(ECS persistent deployment, 2000 points).
  • AK/SK authentication: authenticated via request headers X-HW-AK / X-HW-SK / X-HW-Security-Token , no dependency on hcloud CLI.
  • Additional request headers for ECS step:intermediate , carried when submitting X-HW-PROJECT-ID / X-HW-REGION。
  • Pure Node.js script:submit.mjs(Node ≥ 18, no external dependencies), does not use KooCLI.
  • Optional exhibition hall publishing: always ask after sandbox deployment; if not published, ask again after ECS; if already published, do not ask again.
  • Resource cleanup reminder: after successful ECS submission, remind the user to clean up pay-as-you-go resources.

When to Use

  • When the user says "submit the work/result/sandbox link to the activity", "help me submit the challenge result", "submit the sandbox domain/public address", etc.
  • When the activity has generated a sandbox work link (frontend site) and/or ECS public address that needs to be submitted to the corresponding step.
  • Only for the activity activity_code = open-capability-2026-1024。

Submission API

Item Value
Base address (production, fixed) https://open-dataset.huaweicloud.com/api/v1/hdopenservice/agent
Submit POST {base}/submit-activity-work

Frontend page uses /user/...(SSO login session); Agent uses /agent/...(AK/SK request headers); both haveidentical request body and response. This skill always uses the production environmentbase address and does not switch environments.

Authentication (AK/SK request headers):

  • X-HW-AK(required): Huawei Cloud Access Key
  • X-HW-SK(required): Huawei Cloud Secret Key
  • X-HW-Security-Token(optional): required when using STS temporary credentials

Additional request headers for ECS step(only carried when submitting intermediate(ECS persistent deployment)):

  • X-HW-PROJECT-ID: Project ID of the ECS
  • X-HW-REGION: region of the ECS (e.g., cn-north-4)

Credential priority: command-line arguments > environment variables (HW_ACCESS_KEY/HW_SECRET_KEY/HW_SECURITY_TOKEN, compatible with HUAWEICLOUD_SDK_AK/HUAWEICLOUD_SDK_SK/HUAWEICLOUD_SDK_SECURITY_TOKEN、HW_AK/HW_SK)。Never write credentials into the repository.

Submission request body(Content-Type: application/json, consistent with /user/submit-activity-work ):

{
  "activity_code": "open-capability-2026-1024",
  "milestone": "beginner | intermediate",
  "work_link": "https://xxx.devbridge-s2.hwtunnel.com",
  "api_link": "http://<ECS_EIP>/hc-activity/index.html",
  "summary": "作品说明(可选,≤500 字)"
}

Fields by step:

  • beginner(sandbox deployment): pass only work_link(Sandbox site link)
  • intermediate(ECS persistent deployment): pass only api_link(ECS public access address,must include index.html, e.g. http://<EIP>/hc-activity/index.html)

Response:{ "code": "success", "message": "..." };code === "success" means submission succeeded.

Steps, field mapping, validation and points

Two steps, must bein ordersubmit:beginner(sandbox deployment) → intermediate(ECS persistent deployment); the next step can only be submitted after the previous step passes.

Field/value mapping (important): backend milestone valuesfollow the old version beginner / intermediate(the page copy has been renamed to "Sandbox Deployment / ECS Persistent Deployment"); the old advanced stephas been removed, and does not exist.

Page step milestone value Submission field
Sandbox deployment beginner work_link
ECS persistent deployment intermediate api_link

--milestone also accepts aliases:sandbox→beginner、ecs→intermediate(the script normalizes automatically).

Sandbox domain regex (same as frontend SANDBOX_RE):^https:\/\/[^/]*devbridge-s2\.hwtunnel\.com(\/|$)

Step milestone Must submit Validation Points after success
Sandbox deployment beginner Sandbox site link (work_link) Sandbox domain 1000 points (¥100)
ECS persistent deployment intermediate Public access address (api_link) http(s):// starts withand includes index.html(e.g. http://<EIP>/hc-activity/index.html) 2000 points (¥200)

Operating steps (Agent execution)

  1. Collect the link: for the sandbox step, use the public sandbox domain (https://xxx.devbridge-s2.hwtunnel.com, after deployment first curl -sI <URL> to verify 200); for the ECS step, use the ECS public HTML address (http://<EIP>/)。
  2. Determine the current step: determine according to the flow — first submit the sandbox (beginner), and after the sandbox passes, submit ECS (intermediate); submit only the currently completed step.
  3. Validate the link format: the script automatically validates before submission (sandbox domain,http(s):// prefix and index.html, description ≤500 characters); if it does not pass, the reason will be printed; correct it and submit again.
  4. Execute submission: run submit.mjs(see below). Parameters correspond to step fields (this skill always uses the production environment API).
  5. Report back to the user:
    • Success: prompt "Submission succeeded, you have earned {Sandbox Deployment / ECS Persistent Deployment} corresponding points {1000 / 2000} points", and state that this step is complete and the next step can be continued.
    • Failure: feed back verbatim the message(e.g. 里程碑参数不合法、当前里程碑需提交接口地址、作品链接无效、缺少请求头 X-HW-AK)。
  6. Publish to the works exhibition hall (user optional, see next section):beginnerafter (sandbox deployment) is submitted successfullyalways askwhether the user wants to publish the work tothe developer works exhibition hall's challenge activity(at this point the script resets the publish statusto false); if the userhas not published, then after intermediate(ECS persistent deployment) is submitted successfullyask once more; if the sandbox stagehas been published(galleryPublished=true), then in the ECS stagedo not ask again. After successful publishingrun node submit.mjs --gallery-published to record the status。
  7. Resource cleanup (after everything is complete):intermediate(ECS persistent deployment) upon successful submission, allCompleted=true,you mustuse the question tool to ask the user whether to clean up thepay-as-you-go resourcescreated in this activity (options: clean up all / delete ECS only / do not clean up for now), then execute or skip according to the user's choice; the script will also print a cleanup reminder in the success output.

Script usage

The script is located in this skill directory:submit.mjs(pure Node, Node ≥ 18, no additional dependencies required).

# 1) 沙箱部署:提交沙箱域名 URL(milestone=beginner)
node submit.mjs --milestone beginner \
  --work-link https://abcd1234-3000.devbridge-s2.hwtunnel.com \
  --summary "2048 单文件小游戏"

# 2) ECS 持久化部署:提交公网访问地址(milestone=intermediate;链接需含 index.html;带 ECS 的 Project ID / region)
node submit.mjs --milestone intermediate \
  --api-link http://<ECS_EIP>/hc-activity/index.html \
  --project-id <PROJECT_ID> --region cn-north-4

Credentials can be provided via command-line arguments or environment variables:

# PowerShell
$env:HW_ACCESS_KEY = "<AK>"
$env:HW_SECRET_KEY = "<SK>"
$env:HW_SECURITY_TOKEN = "<使用 STS 临时凭证时填写>"   # 可选
# 或直接:node submit.mjs --ak <AK> --sk <SK> [--security-token <token>]

Example success output (actually multi-line JSON):

{
  "ok": true,
  "milestone": "intermediate",
  "label": "ECS 持久化部署",
  "points": 2000,
  "message": "...",
  "allCompleted": true
}

提交成功,已获得ECS 持久化部署对应积分 2000 分。

Publishing to the developer works exhibition hall's challenge activity display (user optional)

When to ask:

  • beginner(sandbox deployment) after successful submission,always askwhether the user wants to publish to the works exhibition hall (the script at this point sets galleryPublished to false);
  • If the sandbox stagehas been published(has run node submit.mjs --gallery-published, i.e. galleryPublished=true)→ intermediate(ECS persistent deployment) stage,do not ask again;
  • If the sandbox stagewas not published(still false) → intermediate(ECS) after successful submission,ask once more。

Whether to publish is decided by the user— publish only if they agree; if they decline, skip it and do not push. After successful publishing,run node submit.mjs --gallery-published to record the status。

Submit directly to this activity by default: works are by default submitted to the works exhibition hall's "challenge activity」,skip training camp selection, and no longer let the user choose a camp.

  • Activity name:闯关活动
  • trainingCampId:47d6ba99-fca0-4797-947d-a8776f506df1
  1. Ask the user(using the question tool): whether to submit the work to thedeveloper works exhibition hall's challenge activitydisplay? (user optional, continue only with explicit consent; if they do not agree, end and do not push)
  2. After the user agrees, execute:
    npx skills add https://gitcode.com/Lingxi-HandsOn/gallery.git --skill publish-work-to-gallery -y 2>&1
    
  3. This command will install the publish-work-to-gallery skill; thenfollow that skill's instructionsto collect and push the code produced by the user's local challenge task work (the actual directories of frontend, backend, and other projects) to the developer works exhibition hall's challenge activity. When publishing,use trainingCampId=47d6ba99-fca0-4797-947d-a8776f506df1(challenge activity) by default。the code directory name is not fixed, so go by the directory the user actually generated/used this time; do not assume a fixed repository name.
  4. If the user does not agree, skip this step and end directly.

Notes:

  • When to ask:beginner(sandbox deployment) after successful submission,always ask; if the userdid not publish, then intermediate(ECS persistent deployment) after successful submissionAsk again; sandbox stagealready published(galleryPublished=true) then the ECS stagewill not ask again(consistent with step 6 of the procedure and the "asking timing" above).
  • Whether to submit to the exhibition hallis entirely up to the user; if the user refuses, skip it, and do not decide on the user's behalf.
  • Before executing, confirm with the user or identify the actual code directories produced by the challenge tasks (frontend and backend projects;directory names are not fixed); push only the relevant code to avoid including unrelated files. This can be specified by the user, or determined by scanning the project directories generated in the current workspace.
  • If npx skills add requires network access/installation, report the error truthfully on failure and let the user decide whether to retry.

Prerequisites

  • Node.js ≥ 18: the submission script of this skill submit.mjs uses native fetch(), requiring Node 18 or later.
  • Huawei Cloud AK/SK: requires a valid Access Key and Secret Key for API authentication request headers. The SecurityToken of STS temporary credentials is optional.
    • Credential source priority: command-line parameters > environment variables (HW_ACCESS_KEY / HW_SECRET_KEY / HW_SECURITY_TOKEN, compatible with HUAWEICLOUD_SDK_AK / HUAWEICLOUD_SDK_SK / HW_AK / HW_SK)。
  • Additional parameters for the ECS stage:intermediate(ECS persistent deployment) submission requires --project-id and --region(or the environment variable HW_PROJECT_ID / HW_REGION, or the hcloud configuration).
  • Network access: must be able to access the submission API base address (https://open-dataset.huaweicloud.com)。
  • Work link:
    • Sandbox deployment stage (beginner): requires a deployed sandbox domain (https://xxx.devbridge-s2.hwtunnel.com format).
    • ECS persistent deployment stage (intermediate): requires the ECS public network access address (including index.html, e.g. http://<EIP>/hc-activity/index.html)。
  • Does not use KooCLI: this skill directly calls the activity API with HTTP request header authentication and does not depend on the hcloud CLI, so the --cli-region parameter is not needed.

Notes

  • Only call APIs, no page operations: do not drive a browser, do not simulate clicking page forms.
  • Fixed environment, no switching: this skill always usesthe production environment; passing in --env / --base and other environment parameters will beignored(no error, no effect), and will not switch to another environment (for the test environment, please use huawei-activity-submit-test)。
  • Sequential submission: the stages must be submitted in the order beginner(sandbox) → intermediate(ECS), and the API validates the order.
  • Additional request headers for the ECS stage:intermediate(ECS persistent deployment) submission requires X-HW-PROJECT-ID(the ECS Project ID) and X-HW-REGION(the ECS region); the script obtains the values through --project-id/--region(or the environment variable HW_PROJECT_ID/HW_REGION, or the hcloud configuration), and an error is reported if they are missing.
  • Strict sandbox domain validation:beginner : the link for the https://xxx.devbridge-s2.hwtunnel.com stage must be a sandbox domain in the formintermediate ; the public address submitted for the http(s):// stage must start with http://<EIP>/hc-activity/index.html(e.g. index.html ); when
  • Credential security: AK/SK (and the SecurityToken for temporary credentials) are used only for this session; do not write them into a repository or commit them to version control; prefer passing them via environment variables to avoid plaintext appearing in command-line history.
  • SK plaintext transmission note:X-HW-SK Transmitting it in plaintext via request headers isthe active API's own design(/agent/* (the interface requires AK/SK headers), and relies on HTTPS transport encryption; do not write the SK into repositories or logs, or share it externally.
  • Submissions cannot be reused: once an address is submitted, it is bound to that account; do not submit the same link again.

Reference Documents