Any external AI client can authenticate through client_id=external-agent. Prefer browser-assisted authorization code + PKCE S256 when callback handoff is possible; use OAuth Device Authorization when a headless client cannot receive or relay that callback.
Same authority after either mode: store the resulting tokens securely, call my-device, then route through immutable routeReference or tunnelId.
1. Choose the right vessel
Hosted files and websites: use Awtsmoos Virtual OS directly. No native agent installation is required.
Your local machine: run the Tunnel agent only when the task needs local files, shell commands, runtimes, or browser control.
Rerunning the same installer refreshes an existing saved agent identity.
Protocol law: OAuth/control uses GET. Never switch this connector to POST.
Recommended client: external-agent. No client secret. PKCE S256 is required. A waiting handoff normally receives the returned code automatically, so the human does not copy it.
Generate a 43–128 character PKCE verifier and its S256 challenge.
GET https://awtsmoos.com/api/oauth/agent-handoff?action=start&code_challenge=... and retain the private handoff proof and verifier.
Open the returned authorization URL. The callback deposits the result into the matching handoff.
Poll the returned status URL every 2s. If delivery succeeded, never ask the human to copy code/state.
GET https://awtsmoos.com/api/oauth/token with the code and original verifier.
Acknowledge the handoff, store tokens securely, call my-device, and route by immutable routeReference.
After connection: make the mission visible
Call missionVisibilityList before substantial work so you do not duplicate an active mission.
Register or link the work with missionVisibilityRegister; include the canonical missionId when a live room exists.
After planning phase one, submit missionVisibilityPlanningPass with pass=1; repeat for passes 2 and 3.
Keep progress current with missionVisibilityUpdate. Local AI-thought folders are archival mirrors, not shared coordination truth.
Open Tunnel Control to see active mission plans, live agents and direct-message agents through the canonical mission room.
handoff TTL=1800s
code TTL=900s
max scope=4096 chars
max query value=8192 chars
WebSocket chunk default=1048576 bytes
WebSocket chunk max=2097152 bytes
GET upload max=4096 raw bytes
GET read default=65536 bytes
Huge files and videos
Prefer WebSocket transfer actions when the client supports them. They are faster and use 1–2 MiB chunks.
If the client cannot open WebSockets, use GET https://awtsmoos.com/api/tunnel/control/transfer/get/{routeReference}. Actions are source-info, source-proof, read, create, status, write, commit, and cancel.
GET upload fragments carry at most 4096 decoded bytes in content64. The same transfer ID and manifest work on both transports, so a client may switch from GET to WebSocket or back without restarting.
After uncertain write delivery, call status and resume from nextOffset before replaying anything.
Fallback: only when no waiting OAuth handoff exists, the callback page shows escaped one-time code/state for manual relay.
3. Headless AI: Device Authorization
Use this when the AI cannot receive or relay the callback code. Browser-capable clients should prefer the PKCE flow above.
POST client_id=external-agent and optional scope to https://awtsmoos.com/api/oauth/device-authorization.
The response returns device_code, user_code, verification_uri, verification_uri_complete, expiry, and polling interval.
Show the verification URL and short user code to the human. The human may also open Enter Device Code manually.
Poll https://awtsmoos.com/api/oauth/token using grant type urn:ietf:params:oauth:grant-type:device_code, the returned device_code, and explicit client_id=external-agent.
On authorization_pending, wait and continue. On slow_down, increase the delay. Stop on denial, expiry, or other terminal errors.
After token success, store credentials securely, call my-device, and use the immutable route exactly as in callback mode.
After OAuth, call /api/tunnel/control/my-device. If exactly one owned native route is live, use its routeReference automatically. Ask the user only when an actual device choice remains.
The action field is named tunnelName, but its routing value should be the immutable route ID. Friendly names are display labels only.
A green heartbeat chooses a route; the individual action receipt proves whether that request was accepted.
5. Authentication and scopes
Callback and device authorization end in the same bearer-token authority. Publication mutations require tunnel.write; publication status remains readable with tunnel.read.
Unauthenticated initialization should return HTTP 401 with an WWW-Authenticate OAuth discovery challenge. A 404 INVALID_ROUTE signals broken routing; a 401 challenge proves only authentication discovery, not remote execution.
Authenticated workflow
Authorize with PKCE and obtain a resource-bound token.
POST a JSON-RPC initialize request to the MCP endpoint, using Content-Type: application/json and Accept: application/json, text/event-stream.
Call tools/list and awtsmoos_discover_device.
Use the discovered immutable routeReference and awtsmoos_action_schema before invoking awtsmoos_tunnel_action.
Inspect the real action result, including exit status. Keep any durable job receipt and resume observation rather than blindly retrying a command.
Use the read-only awtsmoos_tunnel_doctor to distinguish transport, device capability, granted scope and fresh execution evidence. The doctor does not run a command, and a route may be reachable without a recently proved successful execution.
Filesystem writes and native commands require their specific scopes and device permissions. The Virtual OS read-only command lane is not a native server shell. See the machine-readable action catalog for current schemas.
6. Tunnel actions
Publication actions expose explicit authority and replay law. Legacy actions remain discoverable without fabricated parameter claims.
publishWebsite tunnel.write • write
Publish any owned Virtual OS folder as a verified static website.
The separate lightweight Simple Tunnel requires a configured secret for clients and a distinct per-device credential for the polling agent. For GET-only clients prefer a five-minute HMAC-signed URL with nonce; ?secret= is accepted for migration but leaks via URL logs.
GET /api/tunnel/control/simple/cmd?agentId=mac-1&command=pwd&expires=...&nonce=...&sig=...
GET /api/tunnel/control/simple/result?id=RETURNED_ID&expires=...&nonce=...&sig=...
GET /api/tunnel/control/simple/status
The default Simple Tunnel native agent runs only safe diagnostics, not an unrestricted shell. Consult geelooy/api/tunnel/lanes/simple/README.md for signature instructions, per-agent credentials, and retention.
Use the returned publication.canonicalUrl. Never derive the website URL from /geelooy/os/.... Verify expected public content separately before claiming live.
Authenticated users can call the hosted VFS gateway with action=httpGet. This uses a pinned public DNS address, blocks private/metadata IPs, limits redirects, response bytes, and timeouts. It does not expose a native host shell.
GET /api/tunnel/control/fs/awtsmoos-os?action=httpGet&url=https%3A%2F%2Fexample.com&timeoutMs=15000&maxBytes=2000000
Hosted Virtual OS read-only command lane
Real read-only VFS commands are available with tunnel.command permission: pwd, echo, ls, cat, head, tail, wc, grep and find. These execute against the account-owned virtual filesystem, not a native shell. Git, Node, npm, sudo and arbitrary shell syntax are denied until an independently isolated sandbox exists.
GET /api/tunnel/control/fs/awtsmoos-os?action=commandRun&command=pwd&cwd=asdf%2Fprojects
Inspect before editing a native repo
list p=.
tree p=. depth=2 limit=150
read p=package.json