Process
Parse
$ARGUMENTS:- First token:
URL_OR_ALIAS - Second token:
TASK_ID
If either is missing, output:
Usage: /a2a-cancel <url-or-alias> <task-id>- First token:
Check that
a2ais installed before proceeding:if ! command -v a2a &>/dev/null; then echo "Error: 'a2a' CLI not found. Install with:" echo " go install github.com/a2aproject/a2a-go/v2/cmd/a2a@latest" exit 1 fiResolve the URL and auth, then cancel the task:
URL=$(python3 "${CLAUDE_PLUGIN_ROOT}/scripts/a2a-helper.py" resolve "$URL_OR_ALIAS") AUTH_ARGS=() while IFS= read -r line; do AUTH_ARGS+=("$line") done < <(python3 "${CLAUDE_PLUGIN_ROOT}/scripts/a2a-helper.py" auth "$URL") a2a cancel "$URL" "$TASK_ID" "${AUTH_ARGS[@]}"Update session tracking after cancellation:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/a2a-helper.py" session update "$TASK_ID" "canceled"Report the result: Show the updated task state returned by the CLI. If the task was already in a terminal state, report that cancellation was not needed.