claudish 4.1.0 → 4.2.0
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/index.js +82 -72
- package/package.json +1 -1
- package/recommended-models.json +1 -1
package/dist/index.js
CHANGED
|
@@ -27156,8 +27156,9 @@ var exports_mcp_server = {};
|
|
|
27156
27156
|
__export(exports_mcp_server, {
|
|
27157
27157
|
startMcpServer: () => startMcpServer
|
|
27158
27158
|
});
|
|
27159
|
-
import { readFileSync, existsSync, writeFileSync } from "node:fs";
|
|
27159
|
+
import { readFileSync, existsSync, writeFileSync, mkdirSync } from "node:fs";
|
|
27160
27160
|
import { join, dirname } from "node:path";
|
|
27161
|
+
import { homedir } from "node:os";
|
|
27161
27162
|
import { fileURLToPath } from "node:url";
|
|
27162
27163
|
function loadRecommendedModels() {
|
|
27163
27164
|
if (existsSync(RECOMMENDED_MODELS_PATH)) {
|
|
@@ -27187,6 +27188,7 @@ async function loadAllModels(forceRefresh = false) {
|
|
|
27187
27188
|
throw new Error(`API returned ${response.status}`);
|
|
27188
27189
|
const data = await response.json();
|
|
27189
27190
|
const models = data.data || [];
|
|
27191
|
+
mkdirSync(CLAUDISH_CACHE_DIR, { recursive: true });
|
|
27190
27192
|
writeFileSync(ALL_MODELS_CACHE_PATH, JSON.stringify({
|
|
27191
27193
|
lastUpdated: new Date().toISOString(),
|
|
27192
27194
|
models
|
|
@@ -27425,7 +27427,7 @@ function startMcpServer() {
|
|
|
27425
27427
|
process.exit(1);
|
|
27426
27428
|
});
|
|
27427
27429
|
}
|
|
27428
|
-
var import_dotenv, __filename2, __dirname2, RECOMMENDED_MODELS_PATH, ALL_MODELS_CACHE_PATH, CACHE_MAX_AGE_DAYS = 2;
|
|
27430
|
+
var import_dotenv, __filename2, __dirname2, RECOMMENDED_MODELS_PATH, CLAUDISH_CACHE_DIR, ALL_MODELS_CACHE_PATH, CACHE_MAX_AGE_DAYS = 2;
|
|
27429
27431
|
var init_mcp_server = __esm(() => {
|
|
27430
27432
|
init_mcp();
|
|
27431
27433
|
init_stdio2();
|
|
@@ -27435,7 +27437,8 @@ var init_mcp_server = __esm(() => {
|
|
|
27435
27437
|
__filename2 = fileURLToPath(import.meta.url);
|
|
27436
27438
|
__dirname2 = dirname(__filename2);
|
|
27437
27439
|
RECOMMENDED_MODELS_PATH = join(__dirname2, "../recommended-models.json");
|
|
27438
|
-
|
|
27440
|
+
CLAUDISH_CACHE_DIR = join(homedir(), ".claudish");
|
|
27441
|
+
ALL_MODELS_CACHE_PATH = join(CLAUDISH_CACHE_DIR, "all-models.json");
|
|
27439
27442
|
});
|
|
27440
27443
|
|
|
27441
27444
|
// src/logger.ts
|
|
@@ -27451,7 +27454,7 @@ __export(exports_logger, {
|
|
|
27451
27454
|
getLogLevel: () => getLogLevel,
|
|
27452
27455
|
getLogFilePath: () => getLogFilePath
|
|
27453
27456
|
});
|
|
27454
|
-
import { writeFileSync as writeFileSync2, appendFile, existsSync as existsSync2, mkdirSync } from "fs";
|
|
27457
|
+
import { writeFileSync as writeFileSync2, appendFile, existsSync as existsSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
27455
27458
|
import { join as join2 } from "path";
|
|
27456
27459
|
function flushLogBuffer() {
|
|
27457
27460
|
if (!logFilePath || logBuffer.length === 0)
|
|
@@ -27493,7 +27496,7 @@ function initLogger(debugMode, level = "info") {
|
|
|
27493
27496
|
logLevel = level;
|
|
27494
27497
|
const logsDir = join2(process.cwd(), "logs");
|
|
27495
27498
|
if (!existsSync2(logsDir)) {
|
|
27496
|
-
|
|
27499
|
+
mkdirSync2(logsDir, { recursive: true });
|
|
27497
27500
|
}
|
|
27498
27501
|
const timestamp = new Date().toISOString().replace(/[:.]/g, "-").split("T").join("_").slice(0, -5);
|
|
27499
27502
|
logFilePath = join2(logsDir, `claudish_${timestamp}.log`);
|
|
@@ -27583,7 +27586,7 @@ __export(exports_gemini_oauth, {
|
|
|
27583
27586
|
import { createServer } from "node:http";
|
|
27584
27587
|
import { randomBytes, createHash } from "node:crypto";
|
|
27585
27588
|
import { readFileSync as readFileSync2, existsSync as existsSync3, unlinkSync, openSync, writeSync, closeSync } from "node:fs";
|
|
27586
|
-
import { homedir } from "node:os";
|
|
27589
|
+
import { homedir as homedir2 } from "node:os";
|
|
27587
27590
|
import { join as join3 } from "node:path";
|
|
27588
27591
|
import { exec } from "node:child_process";
|
|
27589
27592
|
import { promisify } from "node:util";
|
|
@@ -27607,7 +27610,7 @@ class GeminiOAuth {
|
|
|
27607
27610
|
return this.credentials !== null && !!this.credentials.refresh_token;
|
|
27608
27611
|
}
|
|
27609
27612
|
getCredentialsPath() {
|
|
27610
|
-
const claudishDir = join3(
|
|
27613
|
+
const claudishDir = join3(homedir2(), ".claudish");
|
|
27611
27614
|
return join3(claudishDir, "gemini-oauth.json");
|
|
27612
27615
|
}
|
|
27613
27616
|
async login() {
|
|
@@ -27725,10 +27728,10 @@ Details: ${e.message}`);
|
|
|
27725
27728
|
}
|
|
27726
27729
|
saveCredentials(credentials) {
|
|
27727
27730
|
const credPath = this.getCredentialsPath();
|
|
27728
|
-
const claudishDir = join3(
|
|
27731
|
+
const claudishDir = join3(homedir2(), ".claudish");
|
|
27729
27732
|
if (!existsSync3(claudishDir)) {
|
|
27730
|
-
const { mkdirSync:
|
|
27731
|
-
|
|
27733
|
+
const { mkdirSync: mkdirSync3 } = __require("node:fs");
|
|
27734
|
+
mkdirSync3(claudishDir, { recursive: true });
|
|
27732
27735
|
}
|
|
27733
27736
|
const fd = openSync(credPath, "w", 384);
|
|
27734
27737
|
try {
|
|
@@ -28032,12 +28035,12 @@ var init_gemini_oauth = __esm(() => {
|
|
|
28032
28035
|
});
|
|
28033
28036
|
|
|
28034
28037
|
// src/profile-config.ts
|
|
28035
|
-
import { existsSync as existsSync4, mkdirSync as
|
|
28036
|
-
import { homedir as
|
|
28038
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync3 } from "node:fs";
|
|
28039
|
+
import { homedir as homedir3 } from "node:os";
|
|
28037
28040
|
import { join as join4 } from "node:path";
|
|
28038
28041
|
function ensureConfigDir() {
|
|
28039
28042
|
if (!existsSync4(CONFIG_DIR)) {
|
|
28040
|
-
|
|
28043
|
+
mkdirSync3(CONFIG_DIR, { recursive: true });
|
|
28041
28044
|
}
|
|
28042
28045
|
}
|
|
28043
28046
|
function loadConfig() {
|
|
@@ -28152,7 +28155,7 @@ function listProfiles() {
|
|
|
28152
28155
|
}
|
|
28153
28156
|
var CONFIG_DIR, CONFIG_FILE, DEFAULT_CONFIG;
|
|
28154
28157
|
var init_profile_config = __esm(() => {
|
|
28155
|
-
CONFIG_DIR = join4(
|
|
28158
|
+
CONFIG_DIR = join4(homedir3(), ".claudish");
|
|
28156
28159
|
CONFIG_FILE = join4(CONFIG_DIR, "config.json");
|
|
28157
28160
|
DEFAULT_CONFIG = {
|
|
28158
28161
|
version: "1.0.0",
|
|
@@ -30402,8 +30405,9 @@ __export(exports_model_selector, {
|
|
|
30402
30405
|
promptForApiKey: () => promptForApiKey,
|
|
30403
30406
|
confirmAction: () => confirmAction
|
|
30404
30407
|
});
|
|
30405
|
-
import { readFileSync as readFileSync4, writeFileSync as writeFileSync4, existsSync as existsSync5 } from "node:fs";
|
|
30408
|
+
import { readFileSync as readFileSync4, writeFileSync as writeFileSync4, existsSync as existsSync5, mkdirSync as mkdirSync4 } from "node:fs";
|
|
30406
30409
|
import { join as join5, dirname as dirname2 } from "node:path";
|
|
30410
|
+
import { homedir as homedir4 } from "node:os";
|
|
30407
30411
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
30408
30412
|
function loadRecommendedModels2() {
|
|
30409
30413
|
if (existsSync5(RECOMMENDED_MODELS_JSON_PATH)) {
|
|
@@ -30440,6 +30444,7 @@ async function fetchAllModels(forceUpdate = false) {
|
|
|
30440
30444
|
throw new Error(`API returned ${response.status}`);
|
|
30441
30445
|
const data = await response.json();
|
|
30442
30446
|
const models = data.data;
|
|
30447
|
+
mkdirSync4(CLAUDISH_CACHE_DIR2, { recursive: true });
|
|
30443
30448
|
writeFileSync4(ALL_MODELS_JSON_PATH, JSON.stringify({
|
|
30444
30449
|
lastUpdated: new Date().toISOString(),
|
|
30445
30450
|
models
|
|
@@ -30744,12 +30749,13 @@ async function selectProfile(profiles) {
|
|
|
30744
30749
|
async function confirmAction(message) {
|
|
30745
30750
|
return dist_default2({ message, default: false });
|
|
30746
30751
|
}
|
|
30747
|
-
var __filename3, __dirname3, ALL_MODELS_JSON_PATH, RECOMMENDED_MODELS_JSON_PATH, CACHE_MAX_AGE_DAYS2 = 2, FREE_MODELS_CACHE_MAX_AGE_HOURS = 3;
|
|
30752
|
+
var __filename3, __dirname3, CLAUDISH_CACHE_DIR2, ALL_MODELS_JSON_PATH, RECOMMENDED_MODELS_JSON_PATH, CACHE_MAX_AGE_DAYS2 = 2, FREE_MODELS_CACHE_MAX_AGE_HOURS = 3;
|
|
30748
30753
|
var init_model_selector = __esm(() => {
|
|
30749
30754
|
init_dist8();
|
|
30750
30755
|
__filename3 = fileURLToPath2(import.meta.url);
|
|
30751
30756
|
__dirname3 = dirname2(__filename3);
|
|
30752
|
-
|
|
30757
|
+
CLAUDISH_CACHE_DIR2 = join5(homedir4(), ".claudish");
|
|
30758
|
+
ALL_MODELS_JSON_PATH = join5(CLAUDISH_CACHE_DIR2, "all-models.json");
|
|
30753
30759
|
RECOMMENDED_MODELS_JSON_PATH = join5(__dirname3, "../recommended-models.json");
|
|
30754
30760
|
});
|
|
30755
30761
|
|
|
@@ -31114,8 +31120,8 @@ __export(exports_claude_runner, {
|
|
|
31114
31120
|
checkClaudeInstalled: () => checkClaudeInstalled
|
|
31115
31121
|
});
|
|
31116
31122
|
import { spawn } from "node:child_process";
|
|
31117
|
-
import { writeFileSync as writeFileSync5, unlinkSync as unlinkSync2, mkdirSync as
|
|
31118
|
-
import { tmpdir, homedir as
|
|
31123
|
+
import { writeFileSync as writeFileSync5, unlinkSync as unlinkSync2, mkdirSync as mkdirSync5, existsSync as existsSync6 } from "node:fs";
|
|
31124
|
+
import { tmpdir, homedir as homedir5 } from "node:os";
|
|
31119
31125
|
import { join as join6 } from "node:path";
|
|
31120
31126
|
function isWindows() {
|
|
31121
31127
|
return process.platform === "win32";
|
|
@@ -31189,7 +31195,7 @@ function createTempSettingsFile(modelDisplay, port) {
|
|
|
31189
31195
|
const homeDir = process.env.HOME || process.env.USERPROFILE || tmpdir();
|
|
31190
31196
|
const claudishDir = join6(homeDir, ".claudish");
|
|
31191
31197
|
try {
|
|
31192
|
-
|
|
31198
|
+
mkdirSync5(claudishDir, { recursive: true });
|
|
31193
31199
|
} catch {}
|
|
31194
31200
|
const timestamp = Date.now();
|
|
31195
31201
|
const tempPath = join6(claudishDir, `settings-${timestamp}.json`);
|
|
@@ -31289,7 +31295,7 @@ async function runClaudeWithProxy(config3, proxyUrl) {
|
|
|
31289
31295
|
console.error("Install it from: https://claude.com/claude-code");
|
|
31290
31296
|
console.error(`
|
|
31291
31297
|
Or set CLAUDE_PATH to your custom installation:`);
|
|
31292
|
-
const home =
|
|
31298
|
+
const home = homedir5();
|
|
31293
31299
|
const localPath = isWindows() ? join6(home, ".claude", "local", "claude.exe") : join6(home, ".claude", "local", "claude");
|
|
31294
31300
|
console.error(` export CLAUDE_PATH=${localPath}`);
|
|
31295
31301
|
process.exit(1);
|
|
@@ -31333,7 +31339,7 @@ async function findClaudeBinary() {
|
|
|
31333
31339
|
return process.env.CLAUDE_PATH;
|
|
31334
31340
|
}
|
|
31335
31341
|
}
|
|
31336
|
-
const home =
|
|
31342
|
+
const home = homedir5();
|
|
31337
31343
|
const localPath = isWindows2 ? join6(home, ".claude", "local", "claude.exe") : join6(home, ".claude", "local", "claude");
|
|
31338
31344
|
if (existsSync6(localPath)) {
|
|
31339
31345
|
return localPath;
|
|
@@ -32471,9 +32477,10 @@ __export(exports_cli, {
|
|
|
32471
32477
|
getMissingKeyResolutions: () => getMissingKeyResolutions,
|
|
32472
32478
|
getMissingKeyError: () => getMissingKeyError
|
|
32473
32479
|
});
|
|
32474
|
-
import { readFileSync as readFileSync6, writeFileSync as writeFileSync6, existsSync as existsSync8, mkdirSync as
|
|
32480
|
+
import { readFileSync as readFileSync6, writeFileSync as writeFileSync6, existsSync as existsSync8, mkdirSync as mkdirSync6, copyFileSync } from "node:fs";
|
|
32475
32481
|
import { fileURLToPath as fileURLToPath4 } from "node:url";
|
|
32476
32482
|
import { dirname as dirname4, join as join8 } from "node:path";
|
|
32483
|
+
import { homedir as homedir6 } from "node:os";
|
|
32477
32484
|
function getVersion() {
|
|
32478
32485
|
return VERSION;
|
|
32479
32486
|
}
|
|
@@ -32753,6 +32760,7 @@ async function searchAndPrintModels(query, forceUpdate) {
|
|
|
32753
32760
|
throw new Error(`API returned ${response.status}`);
|
|
32754
32761
|
const data = await response.json();
|
|
32755
32762
|
models = data.data;
|
|
32763
|
+
mkdirSync6(CLAUDISH_CACHE_DIR3, { recursive: true });
|
|
32756
32764
|
writeFileSync6(ALL_MODELS_JSON_PATH2, JSON.stringify({
|
|
32757
32765
|
lastUpdated: new Date().toISOString(),
|
|
32758
32766
|
models
|
|
@@ -32863,6 +32871,7 @@ async function printAllModels(jsonOutput, forceUpdate) {
|
|
|
32863
32871
|
throw new Error(`API returned ${response.status}`);
|
|
32864
32872
|
const data = await response.json();
|
|
32865
32873
|
models = data.data;
|
|
32874
|
+
mkdirSync6(CLAUDISH_CACHE_DIR3, { recursive: true });
|
|
32866
32875
|
writeFileSync6(ALL_MODELS_JSON_PATH2, JSON.stringify({
|
|
32867
32876
|
lastUpdated: new Date().toISOString(),
|
|
32868
32877
|
models
|
|
@@ -33482,15 +33491,15 @@ async function initializeClaudishSkill() {
|
|
|
33482
33491
|
}
|
|
33483
33492
|
try {
|
|
33484
33493
|
if (!existsSync8(claudeDir)) {
|
|
33485
|
-
|
|
33494
|
+
mkdirSync6(claudeDir, { recursive: true });
|
|
33486
33495
|
console.log("\uD83D\uDCC1 Created .claude/ directory");
|
|
33487
33496
|
}
|
|
33488
33497
|
if (!existsSync8(skillsDir)) {
|
|
33489
|
-
|
|
33498
|
+
mkdirSync6(skillsDir, { recursive: true });
|
|
33490
33499
|
console.log("\uD83D\uDCC1 Created .claude/skills/ directory");
|
|
33491
33500
|
}
|
|
33492
33501
|
if (!existsSync8(claudishSkillDir)) {
|
|
33493
|
-
|
|
33502
|
+
mkdirSync6(claudishSkillDir, { recursive: true });
|
|
33494
33503
|
console.log("\uD83D\uDCC1 Created .claude/skills/claudish-usage/ directory");
|
|
33495
33504
|
}
|
|
33496
33505
|
copyFileSync(sourceSkillPath, skillFile);
|
|
@@ -33649,7 +33658,7 @@ async function fetchZenModels() {
|
|
|
33649
33658
|
return [];
|
|
33650
33659
|
}
|
|
33651
33660
|
}
|
|
33652
|
-
var __filename5, __dirname5, VERSION = "4.
|
|
33661
|
+
var __filename5, __dirname5, VERSION = "4.2.0", CACHE_MAX_AGE_DAYS3 = 2, MODELS_JSON_PATH, CLAUDISH_CACHE_DIR3, ALL_MODELS_JSON_PATH2;
|
|
33653
33662
|
var init_cli = __esm(() => {
|
|
33654
33663
|
init_config();
|
|
33655
33664
|
init_model_loader();
|
|
@@ -33662,7 +33671,8 @@ var init_cli = __esm(() => {
|
|
|
33662
33671
|
VERSION = packageJson.version;
|
|
33663
33672
|
} catch {}
|
|
33664
33673
|
MODELS_JSON_PATH = join8(__dirname5, "../recommended-models.json");
|
|
33665
|
-
|
|
33674
|
+
CLAUDISH_CACHE_DIR3 = join8(homedir6(), ".claudish");
|
|
33675
|
+
ALL_MODELS_JSON_PATH2 = join8(CLAUDISH_CACHE_DIR3, "all-models.json");
|
|
33666
33676
|
});
|
|
33667
33677
|
|
|
33668
33678
|
// src/port-manager.ts
|
|
@@ -38047,8 +38057,8 @@ var init_remote_provider_types = __esm(() => {
|
|
|
38047
38057
|
});
|
|
38048
38058
|
|
|
38049
38059
|
// src/handlers/openrouter-handler.ts
|
|
38050
|
-
import { writeFileSync as writeFileSync7, mkdirSync as
|
|
38051
|
-
import { homedir as
|
|
38060
|
+
import { writeFileSync as writeFileSync7, mkdirSync as mkdirSync7 } from "node:fs";
|
|
38061
|
+
import { homedir as homedir7 } from "node:os";
|
|
38052
38062
|
import { join as join9 } from "node:path";
|
|
38053
38063
|
|
|
38054
38064
|
class OpenRouterHandler {
|
|
@@ -38101,8 +38111,8 @@ class OpenRouterHandler {
|
|
|
38101
38111
|
updated_at: Date.now(),
|
|
38102
38112
|
is_free: isFreeModel
|
|
38103
38113
|
};
|
|
38104
|
-
const claudishDir = join9(
|
|
38105
|
-
|
|
38114
|
+
const claudishDir = join9(homedir7(), ".claudish");
|
|
38115
|
+
mkdirSync7(claudishDir, { recursive: true });
|
|
38106
38116
|
writeFileSync7(join9(claudishDir, `tokens-${this.port}.json`), JSON.stringify(data), "utf-8");
|
|
38107
38117
|
} catch (e) {}
|
|
38108
38118
|
}
|
|
@@ -59110,8 +59120,8 @@ var init_local_queue = __esm(() => {
|
|
|
59110
59120
|
});
|
|
59111
59121
|
|
|
59112
59122
|
// src/handlers/local-provider-handler.ts
|
|
59113
|
-
import { writeFileSync as writeFileSync8, mkdirSync as
|
|
59114
|
-
import { homedir as
|
|
59123
|
+
import { writeFileSync as writeFileSync8, mkdirSync as mkdirSync8 } from "node:fs";
|
|
59124
|
+
import { homedir as homedir8 } from "node:os";
|
|
59115
59125
|
import { join as join10 } from "node:path";
|
|
59116
59126
|
|
|
59117
59127
|
class LocalProviderHandler {
|
|
@@ -59291,8 +59301,8 @@ class LocalProviderHandler {
|
|
|
59291
59301
|
provider_name: providerNameMap[this.provider.name] || "Local",
|
|
59292
59302
|
updated_at: Date.now()
|
|
59293
59303
|
};
|
|
59294
|
-
const claudishDir = join10(
|
|
59295
|
-
|
|
59304
|
+
const claudishDir = join10(homedir8(), ".claudish");
|
|
59305
|
+
mkdirSync8(claudishDir, { recursive: true });
|
|
59296
59306
|
writeFileSync8(join10(claudishDir, `tokens-${this.port}.json`), JSON.stringify(data), "utf-8");
|
|
59297
59307
|
} catch (e) {}
|
|
59298
59308
|
}
|
|
@@ -59852,8 +59862,8 @@ var init_gemini_retry = __esm(() => {
|
|
|
59852
59862
|
});
|
|
59853
59863
|
|
|
59854
59864
|
// src/handlers/base-gemini-handler.ts
|
|
59855
|
-
import { writeFileSync as writeFileSync9, mkdirSync as
|
|
59856
|
-
import { homedir as
|
|
59865
|
+
import { writeFileSync as writeFileSync9, mkdirSync as mkdirSync9 } from "node:fs";
|
|
59866
|
+
import { homedir as homedir9 } from "node:os";
|
|
59857
59867
|
import { join as join11 } from "node:path";
|
|
59858
59868
|
|
|
59859
59869
|
class BaseGeminiHandler {
|
|
@@ -59894,8 +59904,8 @@ class BaseGeminiHandler {
|
|
|
59894
59904
|
provider_name: this.getProviderName(),
|
|
59895
59905
|
updated_at: Date.now()
|
|
59896
59906
|
};
|
|
59897
|
-
const claudishDir = join11(
|
|
59898
|
-
|
|
59907
|
+
const claudishDir = join11(homedir9(), ".claudish");
|
|
59908
|
+
mkdirSync9(claudishDir, { recursive: true });
|
|
59899
59909
|
writeFileSync9(join11(claudishDir, `tokens-${this.port}.json`), JSON.stringify(data), "utf-8");
|
|
59900
59910
|
} catch (e) {
|
|
59901
59911
|
log(`[BaseGeminiHandler] Error writing token file: ${e}`);
|
|
@@ -60405,8 +60415,8 @@ var init_gemini_handler = __esm(() => {
|
|
|
60405
60415
|
});
|
|
60406
60416
|
|
|
60407
60417
|
// src/handlers/gemini-codeassist-handler.ts
|
|
60408
|
-
import { writeFileSync as writeFileSync10, mkdirSync as
|
|
60409
|
-
import { homedir as
|
|
60418
|
+
import { writeFileSync as writeFileSync10, mkdirSync as mkdirSync10 } from "node:fs";
|
|
60419
|
+
import { homedir as homedir10 } from "node:os";
|
|
60410
60420
|
import { join as join12 } from "node:path";
|
|
60411
60421
|
import { randomUUID } from "node:crypto";
|
|
60412
60422
|
|
|
@@ -60455,8 +60465,8 @@ class GeminiCodeAssistHandler {
|
|
|
60455
60465
|
provider_name: "Gemini Free",
|
|
60456
60466
|
updated_at: Date.now()
|
|
60457
60467
|
};
|
|
60458
|
-
const claudishDir = join12(
|
|
60459
|
-
|
|
60468
|
+
const claudishDir = join12(homedir10(), ".claudish");
|
|
60469
|
+
mkdirSync10(claudishDir, { recursive: true });
|
|
60460
60470
|
writeFileSync10(join12(claudishDir, `tokens-${this.port}.json`), JSON.stringify(data), "utf-8");
|
|
60461
60471
|
} catch (e) {
|
|
60462
60472
|
log(`[GeminiCodeAssistHandler] Error writing token file: ${e}`);
|
|
@@ -60871,8 +60881,8 @@ var init_gemini_codeassist_handler = __esm(() => {
|
|
|
60871
60881
|
});
|
|
60872
60882
|
|
|
60873
60883
|
// src/handlers/openai-handler.ts
|
|
60874
|
-
import { writeFileSync as writeFileSync11, mkdirSync as
|
|
60875
|
-
import { homedir as
|
|
60884
|
+
import { writeFileSync as writeFileSync11, mkdirSync as mkdirSync11 } from "node:fs";
|
|
60885
|
+
import { homedir as homedir11 } from "node:os";
|
|
60876
60886
|
import { join as join13 } from "node:path";
|
|
60877
60887
|
|
|
60878
60888
|
class OpenAIHandler {
|
|
@@ -60945,8 +60955,8 @@ class OpenAIHandler {
|
|
|
60945
60955
|
is_free: isFreeModel,
|
|
60946
60956
|
is_estimated: isEstimate || false
|
|
60947
60957
|
};
|
|
60948
|
-
const claudishDir = join13(
|
|
60949
|
-
|
|
60958
|
+
const claudishDir = join13(homedir11(), ".claudish");
|
|
60959
|
+
mkdirSync11(claudishDir, { recursive: true });
|
|
60950
60960
|
writeFileSync11(join13(claudishDir, `tokens-${this.port}.json`), JSON.stringify(data), "utf-8");
|
|
60951
60961
|
} catch (e) {
|
|
60952
60962
|
log(`[OpenAIHandler] Error writing token file: ${e}`);
|
|
@@ -61553,8 +61563,8 @@ var init_openai_handler = __esm(() => {
|
|
|
61553
61563
|
});
|
|
61554
61564
|
|
|
61555
61565
|
// src/handlers/anthropic-compat-handler.ts
|
|
61556
|
-
import { mkdirSync as
|
|
61557
|
-
import { homedir as
|
|
61566
|
+
import { mkdirSync as mkdirSync12, writeFileSync as writeFileSync12 } from "node:fs";
|
|
61567
|
+
import { homedir as homedir12 } from "node:os";
|
|
61558
61568
|
import { join as join14 } from "node:path";
|
|
61559
61569
|
|
|
61560
61570
|
class AnthropicCompatHandler {
|
|
@@ -61616,8 +61626,8 @@ class AnthropicCompatHandler {
|
|
|
61616
61626
|
provider_name: providerDisplayName,
|
|
61617
61627
|
updated_at: Date.now()
|
|
61618
61628
|
};
|
|
61619
|
-
const claudishDir = join14(
|
|
61620
|
-
|
|
61629
|
+
const claudishDir = join14(homedir12(), ".claudish");
|
|
61630
|
+
mkdirSync12(claudishDir, { recursive: true });
|
|
61621
61631
|
writeFileSync12(join14(claudishDir, `tokens-${this.port}.json`), JSON.stringify(data), "utf-8");
|
|
61622
61632
|
} catch (e) {
|
|
61623
61633
|
log(`[AnthropicCompatHandler] Error writing token file: ${e}`);
|
|
@@ -61745,7 +61755,7 @@ var init_anthropic_compat_handler = __esm(() => {
|
|
|
61745
61755
|
import { exec as exec3 } from "node:child_process";
|
|
61746
61756
|
import { promisify as promisify2 } from "node:util";
|
|
61747
61757
|
import { existsSync as existsSync9 } from "node:fs";
|
|
61748
|
-
import { homedir as
|
|
61758
|
+
import { homedir as homedir13 } from "node:os";
|
|
61749
61759
|
import { join as join15 } from "node:path";
|
|
61750
61760
|
|
|
61751
61761
|
class VertexAuthManager {
|
|
@@ -61800,7 +61810,7 @@ class VertexAuthManager {
|
|
|
61800
61810
|
}
|
|
61801
61811
|
async tryADC() {
|
|
61802
61812
|
try {
|
|
61803
|
-
const adcPath = join15(
|
|
61813
|
+
const adcPath = join15(homedir13(), ".config/gcloud/application_default_credentials.json");
|
|
61804
61814
|
if (!existsSync9(adcPath)) {
|
|
61805
61815
|
log("[VertexAuth] ADC credentials file not found");
|
|
61806
61816
|
return null;
|
|
@@ -61864,7 +61874,7 @@ function validateVertexOAuthConfig() {
|
|
|
61864
61874
|
` + ` export VERTEX_PROJECT='your-gcp-project-id'
|
|
61865
61875
|
` + " export VERTEX_LOCATION='us-central1' # optional";
|
|
61866
61876
|
}
|
|
61867
|
-
const adcPath = join15(
|
|
61877
|
+
const adcPath = join15(homedir13(), ".config/gcloud/application_default_credentials.json");
|
|
61868
61878
|
const hasADC = existsSync9(adcPath);
|
|
61869
61879
|
const hasServiceAccount = !!process.env.GOOGLE_APPLICATION_CREDENTIALS;
|
|
61870
61880
|
if (!hasADC && !hasServiceAccount) {
|
|
@@ -61901,8 +61911,8 @@ var init_vertex_auth = __esm(() => {
|
|
|
61901
61911
|
});
|
|
61902
61912
|
|
|
61903
61913
|
// src/handlers/vertex-oauth-handler.ts
|
|
61904
|
-
import { writeFileSync as writeFileSync13, mkdirSync as
|
|
61905
|
-
import { homedir as
|
|
61914
|
+
import { writeFileSync as writeFileSync13, mkdirSync as mkdirSync13 } from "node:fs";
|
|
61915
|
+
import { homedir as homedir14 } from "node:os";
|
|
61906
61916
|
import { join as join16 } from "node:path";
|
|
61907
61917
|
function parseVertexModel(modelId) {
|
|
61908
61918
|
const parts = modelId.split("/");
|
|
@@ -61959,8 +61969,8 @@ class VertexOAuthHandler {
|
|
|
61959
61969
|
provider_name: "Vertex AI",
|
|
61960
61970
|
updated_at: Date.now()
|
|
61961
61971
|
};
|
|
61962
|
-
const claudishDir = join16(
|
|
61963
|
-
|
|
61972
|
+
const claudishDir = join16(homedir14(), ".claudish");
|
|
61973
|
+
mkdirSync13(claudishDir, { recursive: true });
|
|
61964
61974
|
writeFileSync13(join16(claudishDir, `tokens-${this.port}.json`), JSON.stringify(data), "utf-8");
|
|
61965
61975
|
} catch (e) {
|
|
61966
61976
|
log(`[VertexOAuth] Error writing token file: ${e}`);
|
|
@@ -63335,8 +63345,8 @@ var init_poe_handler = __esm(() => {
|
|
|
63335
63345
|
});
|
|
63336
63346
|
|
|
63337
63347
|
// src/handlers/ollamacloud-handler.ts
|
|
63338
|
-
import { writeFileSync as writeFileSync14, mkdirSync as
|
|
63339
|
-
import { homedir as
|
|
63348
|
+
import { writeFileSync as writeFileSync14, mkdirSync as mkdirSync14 } from "node:fs";
|
|
63349
|
+
import { homedir as homedir15 } from "node:os";
|
|
63340
63350
|
import { join as join17 } from "node:path";
|
|
63341
63351
|
|
|
63342
63352
|
class OllamaCloudHandler {
|
|
@@ -63422,8 +63432,8 @@ class OllamaCloudHandler {
|
|
|
63422
63432
|
provider_name: "OllamaCloud",
|
|
63423
63433
|
updated_at: Date.now()
|
|
63424
63434
|
};
|
|
63425
|
-
const claudishDir = join17(
|
|
63426
|
-
|
|
63435
|
+
const claudishDir = join17(homedir15(), ".claudish");
|
|
63436
|
+
mkdirSync14(claudishDir, { recursive: true });
|
|
63427
63437
|
writeFileSync14(join17(claudishDir, `tokens-${this.port}.json`), JSON.stringify(data), "utf-8");
|
|
63428
63438
|
} catch (e) {}
|
|
63429
63439
|
}
|
|
@@ -63637,8 +63647,8 @@ var init_ollamacloud_handler = __esm(() => {
|
|
|
63637
63647
|
});
|
|
63638
63648
|
|
|
63639
63649
|
// src/services/pricing-cache.ts
|
|
63640
|
-
import { readFileSync as readFileSync8, writeFileSync as writeFileSync15, existsSync as existsSync10, mkdirSync as
|
|
63641
|
-
import { homedir as
|
|
63650
|
+
import { readFileSync as readFileSync8, writeFileSync as writeFileSync15, existsSync as existsSync10, mkdirSync as mkdirSync15, statSync } from "node:fs";
|
|
63651
|
+
import { homedir as homedir16 } from "node:os";
|
|
63642
63652
|
import { join as join18 } from "node:path";
|
|
63643
63653
|
function getDynamicPricingSync(provider, modelName) {
|
|
63644
63654
|
if (provider === "openrouter") {
|
|
@@ -63721,7 +63731,7 @@ function loadDiskCache() {
|
|
|
63721
63731
|
}
|
|
63722
63732
|
function saveDiskCache() {
|
|
63723
63733
|
try {
|
|
63724
|
-
|
|
63734
|
+
mkdirSync15(CACHE_DIR, { recursive: true });
|
|
63725
63735
|
const data = {};
|
|
63726
63736
|
for (const [key, pricing] of pricingMap) {
|
|
63727
63737
|
data[key] = pricing;
|
|
@@ -63756,7 +63766,7 @@ var init_pricing_cache = __esm(() => {
|
|
|
63756
63766
|
init_model_loader();
|
|
63757
63767
|
init_remote_provider_types();
|
|
63758
63768
|
pricingMap = new Map;
|
|
63759
|
-
CACHE_DIR = join18(
|
|
63769
|
+
CACHE_DIR = join18(homedir16(), ".claudish");
|
|
63760
63770
|
CACHE_FILE = join18(CACHE_DIR, "pricing-cache.json");
|
|
63761
63771
|
CACHE_TTL_MS = 24 * 60 * 60 * 1000;
|
|
63762
63772
|
PROVIDER_TO_OR_PREFIX = {
|
|
@@ -64025,8 +64035,8 @@ __export(exports_update_checker, {
|
|
|
64025
64035
|
checkForUpdates: () => checkForUpdates
|
|
64026
64036
|
});
|
|
64027
64037
|
import { execSync } from "node:child_process";
|
|
64028
|
-
import { existsSync as existsSync11, mkdirSync as
|
|
64029
|
-
import { homedir as
|
|
64038
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync16, readFileSync as readFileSync9, unlinkSync as unlinkSync3, writeFileSync as writeFileSync16 } from "node:fs";
|
|
64039
|
+
import { homedir as homedir17, platform, tmpdir as tmpdir2 } from "node:os";
|
|
64030
64040
|
import { join as join19 } from "node:path";
|
|
64031
64041
|
import { createInterface as createInterface2 } from "node:readline";
|
|
64032
64042
|
function getUpdateCommand() {
|
|
@@ -64039,14 +64049,14 @@ function getUpdateCommand() {
|
|
|
64039
64049
|
function getCacheFilePath() {
|
|
64040
64050
|
let cacheDir;
|
|
64041
64051
|
if (isWindows2) {
|
|
64042
|
-
const localAppData = process.env.LOCALAPPDATA || join19(
|
|
64052
|
+
const localAppData = process.env.LOCALAPPDATA || join19(homedir17(), "AppData", "Local");
|
|
64043
64053
|
cacheDir = join19(localAppData, "claudish");
|
|
64044
64054
|
} else {
|
|
64045
|
-
cacheDir = join19(
|
|
64055
|
+
cacheDir = join19(homedir17(), ".cache", "claudish");
|
|
64046
64056
|
}
|
|
64047
64057
|
try {
|
|
64048
64058
|
if (!existsSync11(cacheDir)) {
|
|
64049
|
-
|
|
64059
|
+
mkdirSync16(cacheDir, { recursive: true });
|
|
64050
64060
|
}
|
|
64051
64061
|
return join19(cacheDir, "update-check.json");
|
|
64052
64062
|
} catch {
|
package/package.json
CHANGED