krasavacode 0.3.2 → 0.3.3
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/bin/krasavacode.js +1 -1
- package/package.json +1 -1
- package/src/launch.js +11 -0
- package/src/preset.js +4 -3
package/bin/krasavacode.js
CHANGED
|
@@ -8,7 +8,7 @@ import { runDoctor } from '../src/doctor.js';
|
|
|
8
8
|
import { runSetupGemini } from '../src/setup-gemini.js';
|
|
9
9
|
|
|
10
10
|
// Hardcoded so it works inside Bun --compile (no FS access to package.json)
|
|
11
|
-
const VERSION = '0.3.
|
|
11
|
+
const VERSION = '0.3.3';
|
|
12
12
|
|
|
13
13
|
const cmd = process.argv[2];
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "krasavacode",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "KRASAVACODE — однокнопочный бесплатный вайбкодинг для учеников. Claude Code на бесплатных провайдерах через локальный gateway. Сам ставит Node при необходимости.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/launch.js
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
+
import { mkdir } from 'node:fs/promises';
|
|
3
|
+
import { homedir } from 'node:os';
|
|
4
|
+
import { join } from 'node:path';
|
|
2
5
|
import { isGeminiConfigured } from './setup-gemini.js';
|
|
3
6
|
|
|
4
7
|
const PLACEHOLDER_TOKEN = 'sk-krasavacode-local';
|
|
8
|
+
const CLAUDE_CONFIG_DIR = join(homedir(), '.krasavacode', 'claude-config');
|
|
5
9
|
|
|
6
10
|
export async function launchClaude(paths, hub /*, detection */) {
|
|
7
11
|
const geminiOn = await isGeminiConfigured();
|
|
12
|
+
// Isolate Claude Code's config/credentials from any real Anthropic login
|
|
13
|
+
// the student may have on this machine (~/.claude/). This is the *only*
|
|
14
|
+
// way to suppress the "Welcome back, NAME · publerplatforma@gmail.com's
|
|
15
|
+
// Organization · API Usage Billing" header on the welcome screen.
|
|
16
|
+
await mkdir(CLAUDE_CONFIG_DIR, { recursive: true });
|
|
8
17
|
|
|
9
18
|
// Drop any pre-existing ANTHROPIC_API_KEY (from the user's shell or a real
|
|
10
19
|
// Anthropic login) so it doesn't conflict with our auth-token, and so that
|
|
@@ -18,6 +27,8 @@ export async function launchClaude(paths, hub /*, detection */) {
|
|
|
18
27
|
...cleanEnv,
|
|
19
28
|
ANTHROPIC_BASE_URL: hub.baseUrl,
|
|
20
29
|
ANTHROPIC_AUTH_TOKEN: PLACEHOLDER_TOKEN,
|
|
30
|
+
// Isolate config/credentials: own dir, separate from ~/.claude/
|
|
31
|
+
ANTHROPIC_CONFIG_DIR: CLAUDE_CONFIG_DIR,
|
|
21
32
|
DISABLE_AUTOUPDATER: '1',
|
|
22
33
|
DISABLE_TELEMETRY: '1',
|
|
23
34
|
DISABLE_ERROR_REPORTING: '1',
|
package/src/preset.js
CHANGED
|
@@ -19,11 +19,12 @@ function pollinationsProvider() {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function geminiProvider() {
|
|
22
|
+
// gemini-2.5-pro free tier = 0 requests; only flash is actually free.
|
|
22
23
|
return {
|
|
23
24
|
name: 'gemini',
|
|
24
25
|
api_base_url: 'https://generativelanguage.googleapis.com/v1beta/models/',
|
|
25
26
|
api_key: '$GEMINI_API_KEY',
|
|
26
|
-
models: ['gemini-2.5-flash', 'gemini-
|
|
27
|
+
models: ['gemini-2.5-flash', 'gemini-flash-latest'],
|
|
27
28
|
transformer: { use: ['gemini'] },
|
|
28
29
|
};
|
|
29
30
|
}
|
|
@@ -37,8 +38,8 @@ function buildConfig({ withGemini }) {
|
|
|
37
38
|
? {
|
|
38
39
|
default: 'gemini,gemini-2.5-flash',
|
|
39
40
|
background: 'gemini,gemini-2.5-flash',
|
|
40
|
-
think: 'gemini,gemini-2.5-
|
|
41
|
-
longContext: 'gemini,gemini-2.5-
|
|
41
|
+
think: 'gemini,gemini-2.5-flash',
|
|
42
|
+
longContext: 'gemini,gemini-2.5-flash',
|
|
42
43
|
longContextThreshold: 60000,
|
|
43
44
|
}
|
|
44
45
|
: {
|