indusagi 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/utils/oauth/index.d.ts +1 -1
- package/dist/ai/utils/oauth/index.d.ts.map +1 -1
- package/dist/ai/utils/oauth/index.js +3 -4
- package/dist/ai/utils/oauth/index.js.map +1 -1
- package/dist/ai/utils/oauth/kimi.d.ts +15 -12
- package/dist/ai/utils/oauth/kimi.d.ts.map +1 -1
- package/dist/ai/utils/oauth/kimi.js +17 -102
- package/dist/ai/utils/oauth/kimi.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ export { getGitHubCopilotBaseUrl, githubCopilotOAuthProvider, loginGitHubCopilot
|
|
|
14
14
|
export { antigravityOAuthProvider, loginAntigravity, refreshAntigravityToken } from "./google-antigravity.js";
|
|
15
15
|
export { geminiCliOAuthProvider, loginGeminiCli, refreshGoogleCloudToken } from "./google-gemini-cli.js";
|
|
16
16
|
export { loginOpenAICodex, openaiCodexOAuthProvider, refreshOpenAICodexToken } from "./openai-codex.js";
|
|
17
|
-
export {
|
|
17
|
+
export { loginKimi, refreshKimiToken } from "./kimi.js";
|
|
18
18
|
export * from "./types.js";
|
|
19
19
|
import type { OAuthCredentials, OAuthProviderId, OAuthProviderInfo, OAuthProviderInterface } from "./types.js";
|
|
20
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ai/utils/oauth/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE/F,OAAO,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,EACf,yBAAyB,GACzB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,uBAA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CAM9D;AAMD;;;GAGG;AACH,wBAAsB,iBAAiB,CACtC,UAAU,EAAE,eAAe,EAC3B,WAAW,EAAE,gBAAgB,GAC3B,OAAO,CAAC,gBAAgB,CAAC,CAM3B;AAED;;;;;;GAMG;AACH,wBAAsB,cAAc,CACnC,UAAU,EAAE,eAAe,EAC3B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAC3C,OAAO,CAAC;IAAE,cAAc,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC,CAsBtE"}
|
|
@@ -19,8 +19,8 @@ export { antigravityOAuthProvider, loginAntigravity, refreshAntigravityToken } f
|
|
|
19
19
|
export { geminiCliOAuthProvider, loginGeminiCli, refreshGoogleCloudToken } from "./google-gemini-cli.js";
|
|
20
20
|
// OpenAI Codex (ChatGPT OAuth)
|
|
21
21
|
export { loginOpenAICodex, openaiCodexOAuthProvider, refreshOpenAICodexToken } from "./openai-codex.js";
|
|
22
|
-
// Kimi (Moonshot AI)
|
|
23
|
-
export {
|
|
22
|
+
// Kimi (Moonshot AI) - API key only, no OAuth
|
|
23
|
+
export { loginKimi, refreshKimiToken } from "./kimi.js";
|
|
24
24
|
export * from "./types.js";
|
|
25
25
|
// ============================================================================
|
|
26
26
|
// Provider Registry
|
|
@@ -30,14 +30,13 @@ import { githubCopilotOAuthProvider } from "./github-copilot.js";
|
|
|
30
30
|
import { antigravityOAuthProvider } from "./google-antigravity.js";
|
|
31
31
|
import { geminiCliOAuthProvider } from "./google-gemini-cli.js";
|
|
32
32
|
import { openaiCodexOAuthProvider } from "./openai-codex.js";
|
|
33
|
-
import { kimiOAuthProvider } from "./kimi.js";
|
|
34
33
|
const oauthProviderRegistry = new Map([
|
|
35
34
|
[anthropicOAuthProvider.id, anthropicOAuthProvider],
|
|
36
35
|
[githubCopilotOAuthProvider.id, githubCopilotOAuthProvider],
|
|
37
36
|
[geminiCliOAuthProvider.id, geminiCliOAuthProvider],
|
|
38
37
|
[antigravityOAuthProvider.id, antigravityOAuthProvider],
|
|
39
38
|
[openaiCodexOAuthProvider.id, openaiCodexOAuthProvider],
|
|
40
|
-
|
|
39
|
+
// Kimi uses API key auth only — NOT registered as OAuth provider
|
|
41
40
|
]);
|
|
42
41
|
/**
|
|
43
42
|
* Get an OAuth provider by ID
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ai/utils/oauth/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY;AACZ,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC/F,iBAAiB;AACjB,OAAO,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,EACf,yBAAyB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,qBAAqB;AACrB,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC9G,oBAAoB;AACpB,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACzG,+BAA+B;AAC/B,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AACxG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ai/utils/oauth/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,YAAY;AACZ,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC/F,iBAAiB;AACjB,OAAO,EACN,uBAAuB,EACvB,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,EACf,yBAAyB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,qBAAqB;AACrB,OAAO,EAAE,wBAAwB,EAAE,gB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I,CAAC;YACJ,KAAK,GAAG,MAAM,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QAC5C,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,qCAAqC,UAAU,EAAE,CAAC,CAAC;QACpE,CAAC;IACF,CAAC;IAED,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACzC,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Kimi (Moonshot AI)
|
|
2
|
+
* Kimi (Moonshot AI) — API key authentication only.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
*
|
|
4
|
+
* Kimi does NOT support OAuth. Use KIMI_API_KEY or MOONSHOT_API_KEY
|
|
5
|
+
* environment variables, or pass the key directly via --api-key.
|
|
6
|
+
*
|
|
7
|
+
* Get your API key at:
|
|
8
|
+
* Standard Kimi: https://www.moonshot.cn/
|
|
9
|
+
* Kimi Code: https://www.kimi.com/code/en
|
|
10
10
|
*/
|
|
11
|
-
|
|
11
|
+
import type { OAuthCredentials } from "./types.js";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Not a real OAuth login — Kimi uses API keys only.
|
|
14
|
+
* Exported for completeness; callers should use getEnvApiKey("kimi") instead.
|
|
15
|
+
* @throws Always — Kimi does not support OAuth.
|
|
14
16
|
*/
|
|
15
|
-
export declare function
|
|
17
|
+
export declare function loginKimi(): Promise<OAuthCredentials>;
|
|
16
18
|
/**
|
|
17
|
-
* Kimi
|
|
19
|
+
* Not applicable — Kimi uses API keys only, tokens do not expire.
|
|
20
|
+
* @throws Always
|
|
18
21
|
*/
|
|
19
|
-
export declare
|
|
22
|
+
export declare function refreshKimiToken(_refreshToken: string): Promise<OAuthCredentials>;
|
|
20
23
|
//# sourceMappingURL=kimi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kimi.d.ts","sourceRoot":"","sources":["../../../../src/ai/utils/oauth/kimi.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kimi.d.ts","sourceRoot":"","sources":["../../../../src/ai/utils/oauth/kimi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD;;;;GAIG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAK3D;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAEvF"}
|
|
@@ -1,112 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Kimi (Moonshot AI)
|
|
2
|
+
* Kimi (Moonshot AI) — API key authentication only.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Kimi does NOT support OAuth. Use KIMI_API_KEY or MOONSHOT_API_KEY
|
|
5
|
+
* environment variables, or pass the key directly via --api-key.
|
|
6
|
+
*
|
|
7
|
+
* Get your API key at:
|
|
8
|
+
* Standard Kimi: https://www.moonshot.cn/
|
|
9
|
+
* Kimi Code: https://www.kimi.com/code/en
|
|
6
10
|
*/
|
|
7
|
-
// Kimi OAuth configuration
|
|
8
|
-
const CLIENT_ID = "indusagi-kimi"; // This should be registered with Kimi
|
|
9
|
-
const AUTHORIZE_URL = "https://auth.kimi.moonshot.cn/oauth/authorize";
|
|
10
|
-
const TOKEN_URL = "https://auth.kimi.moonshot.cn/oauth/token";
|
|
11
|
-
const REDIRECT_URI = "http://localhost:3000/oauth/callback";
|
|
12
|
-
const SCOPES = "api:access";
|
|
13
11
|
/**
|
|
14
|
-
*
|
|
12
|
+
* Not a real OAuth login — Kimi uses API keys only.
|
|
13
|
+
* Exported for completeness; callers should use getEnvApiKey("kimi") instead.
|
|
14
|
+
* @throws Always — Kimi does not support OAuth.
|
|
15
15
|
*/
|
|
16
|
-
export async function loginKimi(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
method: "POST",
|
|
20
|
-
headers: { "Content-Type": "application/json" },
|
|
21
|
-
body: JSON.stringify({
|
|
22
|
-
client_id: CLIENT_ID,
|
|
23
|
-
scopes: SCOPES,
|
|
24
|
-
}),
|
|
25
|
-
});
|
|
26
|
-
if (!deviceCodeResponse.ok) {
|
|
27
|
-
throw new Error(`Failed to get device code: ${deviceCodeResponse.statusText}`);
|
|
28
|
-
}
|
|
29
|
-
const deviceCodeData = (await deviceCodeResponse.json());
|
|
30
|
-
// Show user the verification URL and code
|
|
31
|
-
callbacks.onAuth({
|
|
32
|
-
url: deviceCodeData.verification_uri,
|
|
33
|
-
instructions: `Enter the code: ${deviceCodeData.user_code}`,
|
|
34
|
-
});
|
|
35
|
-
// Poll for token
|
|
36
|
-
const maxAttempts = 120; // 2 minutes with 1s interval
|
|
37
|
-
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
38
|
-
if (callbacks.signal?.aborted) {
|
|
39
|
-
throw new Error("OAuth login cancelled");
|
|
40
|
-
}
|
|
41
|
-
await new Promise((resolve) => setTimeout(resolve, deviceCodeData.interval * 1000 || 1000));
|
|
42
|
-
const tokenResponse = await fetch(TOKEN_URL, {
|
|
43
|
-
method: "POST",
|
|
44
|
-
headers: { "Content-Type": "application/json" },
|
|
45
|
-
body: JSON.stringify({
|
|
46
|
-
grant_type: "urn:ietf:params:oauth:grant-type:device_code",
|
|
47
|
-
device_code: deviceCodeData.device_code,
|
|
48
|
-
client_id: CLIENT_ID,
|
|
49
|
-
}),
|
|
50
|
-
});
|
|
51
|
-
if (!tokenResponse.ok) {
|
|
52
|
-
const error = (await tokenResponse.json());
|
|
53
|
-
if (error.error === "authorization_pending") {
|
|
54
|
-
// Still waiting for user authorization
|
|
55
|
-
callbacks.onProgress?.(`Waiting for authorization... (${attempt + 1}/${maxAttempts})`);
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
throw new Error(`Token exchange failed: ${error.error || tokenResponse.statusText}`);
|
|
59
|
-
}
|
|
60
|
-
const tokenData = (await tokenResponse.json());
|
|
61
|
-
// Calculate expiry time (current time + expires_in seconds - 5 min buffer)
|
|
62
|
-
const expiresAt = Date.now() + tokenData.expires_in * 1000 - 5 * 60 * 1000;
|
|
63
|
-
return {
|
|
64
|
-
refresh: tokenData.refresh_token,
|
|
65
|
-
access: tokenData.access_token,
|
|
66
|
-
expires: expiresAt,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
throw new Error("OAuth login timeout: User did not authorize within 2 minutes");
|
|
16
|
+
export async function loginKimi() {
|
|
17
|
+
throw new Error("Kimi does not support OAuth. Set KIMI_API_KEY or MOONSHOT_API_KEY in your environment, " +
|
|
18
|
+
"or use `indusagi login --provider kimi` to enter your API key.");
|
|
70
19
|
}
|
|
71
20
|
/**
|
|
72
|
-
*
|
|
21
|
+
* Not applicable — Kimi uses API keys only, tokens do not expire.
|
|
22
|
+
* @throws Always
|
|
73
23
|
*/
|
|
74
|
-
export async function refreshKimiToken(
|
|
75
|
-
|
|
76
|
-
method: "POST",
|
|
77
|
-
headers: { "Content-Type": "application/json" },
|
|
78
|
-
body: JSON.stringify({
|
|
79
|
-
grant_type: "refresh_token",
|
|
80
|
-
client_id: CLIENT_ID,
|
|
81
|
-
refresh_token: refreshToken,
|
|
82
|
-
}),
|
|
83
|
-
});
|
|
84
|
-
if (!response.ok) {
|
|
85
|
-
throw new Error(`Failed to refresh Kimi token: ${response.statusText}`);
|
|
86
|
-
}
|
|
87
|
-
const data = (await response.json());
|
|
88
|
-
const expiresAt = Date.now() + data.expires_in * 1000 - 5 * 60 * 1000;
|
|
89
|
-
return {
|
|
90
|
-
refresh: data.refresh_token,
|
|
91
|
-
access: data.access_token,
|
|
92
|
-
expires: expiresAt,
|
|
93
|
-
};
|
|
24
|
+
export async function refreshKimiToken(_refreshToken) {
|
|
25
|
+
throw new Error("Kimi does not support OAuth token refresh.");
|
|
94
26
|
}
|
|
95
|
-
/**
|
|
96
|
-
* Kimi OAuth Provider Implementation
|
|
97
|
-
*/
|
|
98
|
-
export const kimiOAuthProvider = {
|
|
99
|
-
id: "kimi",
|
|
100
|
-
name: "Kimi (Moonshot AI)",
|
|
101
|
-
usesCallbackServer: false,
|
|
102
|
-
async login(callbacks) {
|
|
103
|
-
return loginKimi(callbacks);
|
|
104
|
-
},
|
|
105
|
-
async refreshToken(credentials) {
|
|
106
|
-
return refreshKimiToken(credentials.refresh);
|
|
107
|
-
},
|
|
108
|
-
getApiKey(credentials) {
|
|
109
|
-
return credentials.access;
|
|
110
|
-
},
|
|
111
|
-
};
|
|
112
27
|
//# sourceMappingURL=kimi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"kimi.js","sourceRoot":"","sources":["../../../../src/ai/utils/oauth/kimi.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"kimi.js","sourceRoot":"","sources":["../../../../src/ai/utils/oauth/kimi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS;IAC9B,MAAM,IAAI,KAAK,CACd,yFAAyF;QACxF,gEAAgE,CACjE,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,aAAqB;IAC3D,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;AAC/D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "indusagi",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "All-in-one package that re-exports indusagi-ai, indusagi-agent, indusagi-tui, and indusagi-webui. Now with Kimi (Moonshot AI) support!",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|