ARK CUA
Operate ARK CUA through the bundled Python CLI. Keep all gateway access inside the CLI and never request an AgentPlan API key in chat.
Command surface
python3 <skill-dir>/scripts/cua.py <command> [options]
Parse the single JSON object printed by each invocation:
- Success:
ok: true, withdataand sometimesnext. - Failure:
ok: false, witherror.codeand sometimesnext.setup_command.
Read references/commands.md for non-core commands. Read references/auth.md, references/outcomes.md, or references/troubleshooting.md only when the corresponding state occurs.
Core workflow
- Run
auth status. - On
AUTH_REQUIRED,TOKEN_EXPIRED, orREFRESH_FAILED, relay the returnedsetup_command. Ask the user to run it in their own local terminal and enter the AgentPlan API key through the hidden prompt. Never run the interactive login from an agent session and never accept the key in chat. - After the user confirms login completed, run
auth statusagain. - Run
delegate --objective "<user request>"once. Preserve the user's objective without planning or decomposing it. - Record
data.invocation_id; never submit the same request again. - Drive
data.outcomeuntil terminal:in_progress: runnext.commandand continue watching.needs_input: relaydata.input_request.questionverbatim, then submit the user's reply withanswer.completed: usedata.result.textas the authoritative result.failed: report the failure; retry only when requested and safe.cancelled: report cancellation.
If task creation returns ACTIVE_RUN_CONFLICT, the new request did not start. Stop, tell the user the desktop is busy, and do not retry or inspect the existing task unless the user explicitly asks.
Route special intents
- Specific desktop or reusable context: use
desktop list,task run,context, andtask continue. - Local file delivery: remove only local-delivery wording from the CUA objective, have CUA export a registered artifact, then use
artifact listandartifact save. - Health or configuration inspection: use
ping,diagnose, ormodel get; do not create a task merely to test availability. - Stop an active task: use
cancelonly when the user explicitly asks.
Safety and result integrity
- Use the bundled gateway in
assets/config.json; allow the same per-call and environment overrides asap-cua-skill. - Configure credentials exactly like
ap-cua-skill: resolve--api-key, thenAP_CUA_AGENTPLAN_API_KEY,AGENTPLAN_API_KEY, orARK_API_KEY, then use the hidden local-terminal prompt when no key is otherwise available. Validate and store successful credentials in the local0600cache. - Never expose API keys, cache contents, authorization headers, user answers, or artifact bytes.
- Never infer completion from progress text or a nonterminal state.
- Treat
result.textas authoritative only whenoutcome == completed. - Refuse to overwrite existing local files. Require a new output path for
artifact save. - Reject HTML/interstitial responses as artifacts and do not write them to disk.
- Do not accept base64 text or an external share link as a downloaded file; require a registered artifact.
- Do not bypass CUA questions, modify persistent model settings, manage schedules, expose desktop access tickets, or invoke desktop reboot/reset operations.