File size: 1,085 Bytes
63522a5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | 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";
|