PKU harness
CloudAPI reference

Share links and pages

Public redirects and static viewer pages for people without the app.

GET
/s/{id}

Redirects to the viewer page the channel was opened with, /w/<plugin>/<page>?c=<id>. The browser keeps the #k= fragment across the redirect; the server never sees it.

Path Parameters

id*string

Server-generated, base64url (16 random bytes → 22 characters).

Match^[A-Za-z0-9_-]{8,64}$

Response Body

Redirect to the plugin's viewer page.

Example Request
curl -X GET 'https://cloud.example.org/s/string'
Example Response
Empty

Static viewer page

GET
/w/{plugin}/{page}

A static page built from plugins/<id>/web and listed in CloudManifest.pages, served with a strict CSP (connect-src 'self'). It reads #k from location.hash, decrypts locally with @pku-harness/cloud-protocol and talks to /v1/c/{id}/….

Path Parameters

plugin*string

Registry id rule, plus mcp-… host ids for remote plugins.

Match^[a-z0-9][a-z0-9-]{1,63}$
page*string
Match^[a-z0-9][a-z0-9-]{0,40}$

Response Body

The page.

response?stringtext/html
Example Request
curl -X GET 'https://cloud.example.org/w/string/string'
Example Response
"string"