mirror of
https://wget.la/https://github.com/leookun/cursor-byok
synced 2026-10-03 18:23:51 +08:00
- Introduced a new Grok authentication plugin, including essential files such as main.ts, provider.ts, and resources.ts. - Implemented OAuth2 device authorization flow in oauth.ts, allowing users to sign in with xAI. - Added model discovery and quota management functionalities in models.ts and resources.ts. - Created a JSON configuration file (plugin.json) for plugin metadata and permissions. - Included SVG asset for the Grok icon. - Developed comprehensive tests in grok_test.ts to ensure functionality and reliability of the plugin.
17 lines
555 B
TypeScript
17 lines
555 B
TypeScript
import { defineProviderPlugin } from "cursor-byok:plugin";
|
|
import { grokDeviceOAuth } from "./oauth.ts";
|
|
import { grokProvider } from "./provider.ts";
|
|
import { credentialImport, presentAccount, refreshAccount, RESOURCE_TYPE } from "./resources.ts";
|
|
|
|
export default defineProviderPlugin({
|
|
providers: [grokProvider],
|
|
resources: [{
|
|
type: RESOURCE_TYPE,
|
|
displayName: { "en-US": "Grok accounts", "zh-CN": "Grok 账号" },
|
|
add: [grokDeviceOAuth],
|
|
import: credentialImport,
|
|
present: presentAccount,
|
|
refresh: refreshAccount,
|
|
}],
|
|
});
|