Download packages/oauth/src/device.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 1.23 kB
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/oauth/src/device.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/oauth/src/device.ts
-
curl -L -o device.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/oauth/src/device.ts
1.23 kB
| /** | |
| * Browser-safe entry for the device-code flow (`@moonshot-ai/kimi-code-oauth/device`). | |
| * | |
| * The package root re-exports `OAuthManager`, token storage, and the identity | |
| * helpers, which pull in `node:fs` / `node:os` / `proper-lockfile` β fine for | |
| * the CLI and desktop hosts, but unloadable in a browser bundle. This entry | |
| * re-exports only the pure-`fetch` surface (every module in its import | |
| * closure is Node-free): the three HTTP wrappers, the shared flow config, | |
| * and the matching types/errors. Keep it that way β anything that needs a | |
| * Node builtin belongs behind the root entry, not here. | |
| * | |
| * Browser callers drive the flow themselves (request β show the verification | |
| * URI β poll β store the token); there is no manager here on purpose. | |
| */ | |
| export { KIMI_CODE_FLOW_CONFIG } from './constants'; | |
| export { | |
| OAuthConnectionError, | |
| OAuthError, | |
| OAuthUnauthorizedError, | |
| RetryableRefreshError, | |
| } from './errors'; | |
| export type { DevicePollResult, RefreshOptions } from './oauth'; | |
| export { pollDeviceToken, refreshAccessToken, requestDeviceAuthorization } from './oauth'; | |
| export type { | |
| DeviceAuthorization, | |
| DeviceHeaders, | |
| OAuthFlowConfig, | |
| OAuthRequestHeaders, | |
| TokenInfo, | |
| } from './types'; | |