MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / constructor

Method constructor

packages/node-sdk/src/auth.ts:102–119  ·  view source on GitHub ↗
(private readonly options: KimiAuthFacadeOptions)

Source from the content-addressed store, hash-verified

100 private readonly toolkit: KimiOAuthToolkit<SDKManagedConfig>;
101
102 constructor(private readonly options: KimiAuthFacadeOptions) {
103 this.toolkit = new KimiOAuthToolkit<SDKManagedConfig>({
104 homeDir: options.homeDir,
105 identity: options.identity,
106 onRefresh: options.onRefresh,
107 configAdapter: {
108 configPath: options.configPath,
109 // Write-path base read: strict (a salvaged base would drop the user's
110 // broken-but-fixable sections on rewrite) with an actionable message.
111 read: () => readConfigFileForUpdate(options.configPath) as SDKManagedConfig,
112 write: async (config) => {
113 await writeConfigFile(options.configPath, config);
114 },
115 apply: applyManagedKimiCodeConfig,
116 remove: applyManagedKimiCodeLogoutConfig,
117 },
118 });
119 }
120
121 async status(providerName?: string | undefined): Promise<AuthStatus> {
122 return this.toolkit.status(providerName, this.resolveRuntimeManagedAuth(providerName).oauthRef);

Callers

nothing calls this directly

Calls 2

readConfigFileForUpdateFunction · 0.90
writeConfigFileFunction · 0.90

Tested by

no test coverage detected