Download src/api/device-flow-client.ts from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 1.09 kB
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/api/device-flow-client.ts
- Command line
-
hf download hf://SaylorTwift/openhands/src/api/device-flow-client.ts
-
curl -L -o device-flow-client.ts https://huggingface.co/SaylorTwift/openhands/resolve/main/src/api/device-flow-client.ts
1.09 kB
| import { | |
| pollForToken as sdkPollForToken, | |
| startDeviceFlow as sdkStartDeviceFlow, | |
| } from "@openhands/typescript-client/client/device-flow-client"; | |
| import type { | |
| DeviceAuthorizationResponse, | |
| DeviceTokenResponse, | |
| PollDeviceTokenOptions, | |
| } from "@openhands/typescript-client/client/device-flow-client"; | |
| import { AGENT_CANVAS_CLIENT_HEADERS } from "./client-source"; | |
| export { | |
| DeviceFlowError, | |
| isOpenHandsCloudHost, | |
| } from "@openhands/typescript-client/client/device-flow-client"; | |
| export function startDeviceFlow( | |
| host: string, | |
| ): Promise<DeviceAuthorizationResponse> { | |
| return sdkStartDeviceFlow(host, { headers: AGENT_CANVAS_CLIENT_HEADERS }); | |
| } | |
| export function pollForToken( | |
| host: string, | |
| deviceCode: string, | |
| options: PollDeviceTokenOptions, | |
| ): Promise<DeviceTokenResponse> { | |
| return sdkPollForToken(host, deviceCode, { | |
| ...options, | |
| headers: AGENT_CANVAS_CLIENT_HEADERS, | |
| }); | |
| } | |
| export type { | |
| DeviceAuthorizationResponse, | |
| DeviceTokenResponse, | |
| PollDeviceTokenOptions as PollOptions, | |
| } from "@openhands/typescript-client/client/device-flow-client"; | |