codeep 1.1.23 → 1.1.25
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/config/providers.d.ts +2 -0
- package/dist/config/providers.js +3 -0
- package/dist/renderer/App.d.ts +1 -0
- package/dist/renderer/App.js +20 -1
- package/dist/renderer/components/Login.d.ts +1 -0
- package/dist/renderer/components/Login.js +26 -4
- package/dist/renderer/main.js +3 -1
- package/package.json +1 -1
|
@@ -24,6 +24,7 @@ export interface ProviderConfig {
|
|
|
24
24
|
defaultModel: string;
|
|
25
25
|
defaultProtocol: 'openai' | 'anthropic';
|
|
26
26
|
envKey?: string;
|
|
27
|
+
subscribeUrl?: string;
|
|
27
28
|
}
|
|
28
29
|
export declare const PROVIDERS: Record<string, ProviderConfig>;
|
|
29
30
|
export type ProviderId = keyof typeof PROVIDERS;
|
|
@@ -32,6 +33,7 @@ export declare function getProviderList(): {
|
|
|
32
33
|
id: string;
|
|
33
34
|
name: string;
|
|
34
35
|
description: string;
|
|
36
|
+
subscribeUrl?: string;
|
|
35
37
|
}[];
|
|
36
38
|
export declare function getProviderModels(providerId: string): {
|
|
37
39
|
id: string;
|
package/dist/config/providers.js
CHANGED
|
@@ -24,6 +24,7 @@ export const PROVIDERS = {
|
|
|
24
24
|
defaultModel: 'glm-4.7',
|
|
25
25
|
defaultProtocol: 'openai',
|
|
26
26
|
envKey: 'ZAI_API_KEY',
|
|
27
|
+
subscribeUrl: 'https://z.ai/subscribe?ic=NXYNXZOV14',
|
|
27
28
|
},
|
|
28
29
|
'minimax': {
|
|
29
30
|
name: 'MiniMax',
|
|
@@ -46,6 +47,7 @@ export const PROVIDERS = {
|
|
|
46
47
|
defaultModel: 'MiniMax-M2.1',
|
|
47
48
|
defaultProtocol: 'anthropic',
|
|
48
49
|
envKey: 'MINIMAX_API_KEY',
|
|
50
|
+
subscribeUrl: 'https://platform.minimax.io/subscribe/coding-plan?code=2lWvoWUhrp&source=link',
|
|
49
51
|
},
|
|
50
52
|
};
|
|
51
53
|
export function getProvider(id) {
|
|
@@ -56,6 +58,7 @@ export function getProviderList() {
|
|
|
56
58
|
id,
|
|
57
59
|
name: config.name,
|
|
58
60
|
description: config.description,
|
|
61
|
+
subscribeUrl: config.subscribeUrl,
|
|
59
62
|
}));
|
|
60
63
|
}
|
|
61
64
|
export function getProviderModels(providerId) {
|
package/dist/renderer/App.d.ts
CHANGED
package/dist/renderer/App.js
CHANGED
|
@@ -1287,6 +1287,20 @@ export class App {
|
|
|
1287
1287
|
this.pasteApiKey();
|
|
1288
1288
|
return;
|
|
1289
1289
|
}
|
|
1290
|
+
// Ctrl+O to open subscribe URL
|
|
1291
|
+
if (event.ctrl && event.key === 'o') {
|
|
1292
|
+
const provider = this.loginProviders[this.loginProviderIndex];
|
|
1293
|
+
if (provider.subscribeUrl) {
|
|
1294
|
+
try {
|
|
1295
|
+
const cmd = process.platform === 'darwin' ? 'open'
|
|
1296
|
+
: process.platform === 'win32' ? 'start'
|
|
1297
|
+
: 'xdg-open';
|
|
1298
|
+
require('child_process').execSync(`${cmd} "${provider.subscribeUrl}"`, { stdio: 'ignore' });
|
|
1299
|
+
}
|
|
1300
|
+
catch { /* ignore */ }
|
|
1301
|
+
}
|
|
1302
|
+
return;
|
|
1303
|
+
}
|
|
1290
1304
|
// Handle paste detection (fast input)
|
|
1291
1305
|
if (event.isPaste && event.key.length > 1) {
|
|
1292
1306
|
this.loginApiKey += event.key.trim();
|
|
@@ -2757,7 +2771,12 @@ export class App {
|
|
|
2757
2771
|
this.screen.writeLine(y, this.loginError, fg.red);
|
|
2758
2772
|
}
|
|
2759
2773
|
y++;
|
|
2760
|
-
|
|
2774
|
+
const hints = ['Ctrl+V Paste'];
|
|
2775
|
+
if (selectedProvider.subscribeUrl) {
|
|
2776
|
+
hints.push('Ctrl+O Get API key');
|
|
2777
|
+
}
|
|
2778
|
+
hints.push('Enter Submit', 'Esc Back');
|
|
2779
|
+
this.screen.writeLine(y, hints.join(' • '), fg.gray);
|
|
2761
2780
|
}
|
|
2762
2781
|
}
|
|
2763
2782
|
/**
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { LineEditor } from '../Input.js';
|
|
5
5
|
import { fg, style } from '../ansi.js';
|
|
6
6
|
import { createBox, centerBox } from './Box.js';
|
|
7
|
+
import { execSync } from 'child_process';
|
|
7
8
|
// Primary color: #f02a30 (Codeep red)
|
|
8
9
|
const PRIMARY_COLOR = fg.rgb(240, 42, 48);
|
|
9
10
|
const PRIMARY_BRIGHT = fg.rgb(255, 80, 85);
|
|
@@ -33,6 +34,11 @@ export class LoginScreen {
|
|
|
33
34
|
this.render();
|
|
34
35
|
return true;
|
|
35
36
|
}
|
|
37
|
+
// Open subscribe URL in browser
|
|
38
|
+
if (event.ctrl && event.key === 'o' && this.options.subscribeUrl) {
|
|
39
|
+
openUrl(this.options.subscribeUrl);
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
36
42
|
// Submit
|
|
37
43
|
if (event.key === 'enter') {
|
|
38
44
|
const value = this.editor.getValue().trim();
|
|
@@ -114,10 +120,12 @@ export class LoginScreen {
|
|
|
114
120
|
contentY++;
|
|
115
121
|
}
|
|
116
122
|
// Help text
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
123
|
+
const helpParts = ['Ctrl+T: Toggle visibility'];
|
|
124
|
+
if (this.options.subscribeUrl) {
|
|
125
|
+
helpParts.push('Ctrl+O: Get API key');
|
|
126
|
+
}
|
|
127
|
+
helpParts.push('Esc: Cancel');
|
|
128
|
+
this.screen.write(contentX, contentY, helpParts.join(' | '), fg.gray);
|
|
121
129
|
// Position cursor
|
|
122
130
|
this.screen.setCursor(cursorX, boxY + 5);
|
|
123
131
|
this.screen.showCursor(true);
|
|
@@ -131,6 +139,20 @@ export class LoginScreen {
|
|
|
131
139
|
this.showKey = false;
|
|
132
140
|
}
|
|
133
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* Open URL in the default browser
|
|
144
|
+
*/
|
|
145
|
+
function openUrl(url) {
|
|
146
|
+
try {
|
|
147
|
+
const cmd = process.platform === 'darwin' ? 'open'
|
|
148
|
+
: process.platform === 'win32' ? 'start'
|
|
149
|
+
: 'xdg-open';
|
|
150
|
+
execSync(`${cmd} "${url}"`, { stdio: 'ignore' });
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
// Silently fail if browser can't be opened
|
|
154
|
+
}
|
|
155
|
+
}
|
|
134
156
|
/**
|
|
135
157
|
* Provider selection screen
|
|
136
158
|
*/
|
package/dist/renderer/main.js
CHANGED
|
@@ -731,7 +731,7 @@ function handleCommand(command, args) {
|
|
|
731
731
|
// Login/Logout
|
|
732
732
|
case 'login': {
|
|
733
733
|
const providers = getProviderList();
|
|
734
|
-
app.showLogin(providers.map(p => ({ id: p.id, name: p.name })), async (result) => {
|
|
734
|
+
app.showLogin(providers.map(p => ({ id: p.id, name: p.name, subscribeUrl: p.subscribeUrl })), async (result) => {
|
|
735
735
|
if (result) {
|
|
736
736
|
setProvider(result.providerId);
|
|
737
737
|
await setApiKey(result.apiKey);
|
|
@@ -1354,6 +1354,7 @@ async function showLoginFlow() {
|
|
|
1354
1354
|
loginScreen = new LoginScreen(screen, input, {
|
|
1355
1355
|
providerName: selectedProvider.name,
|
|
1356
1356
|
error: loginError,
|
|
1357
|
+
subscribeUrl: selectedProvider.subscribeUrl,
|
|
1357
1358
|
onSubmit: async (key) => {
|
|
1358
1359
|
// Validate and save key
|
|
1359
1360
|
if (key.length < 10) {
|
|
@@ -1361,6 +1362,7 @@ async function showLoginFlow() {
|
|
|
1361
1362
|
loginScreen = new LoginScreen(screen, input, {
|
|
1362
1363
|
providerName: selectedProvider.name,
|
|
1363
1364
|
error: loginError,
|
|
1365
|
+
subscribeUrl: selectedProvider.subscribeUrl,
|
|
1364
1366
|
onSubmit: () => { },
|
|
1365
1367
|
onCancel: () => {
|
|
1366
1368
|
cleanup();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.25",
|
|
4
4
|
"description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|