claudish 6.10.0 → 6.10.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/index.js +274 -230
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -13626,6 +13626,18 @@ var init_stdio2 = __esm(() => {
|
|
|
13626
13626
|
});
|
|
13627
13627
|
|
|
13628
13628
|
// src/team-orchestrator.ts
|
|
13629
|
+
var exports_team_orchestrator = {};
|
|
13630
|
+
__export(exports_team_orchestrator, {
|
|
13631
|
+
validateSessionPath: () => validateSessionPath,
|
|
13632
|
+
setupSession: () => setupSession,
|
|
13633
|
+
runModels: () => runModels,
|
|
13634
|
+
parseJudgeVotes: () => parseJudgeVotes,
|
|
13635
|
+
judgeResponses: () => judgeResponses,
|
|
13636
|
+
getStatus: () => getStatus,
|
|
13637
|
+
fisherYatesShuffle: () => fisherYatesShuffle,
|
|
13638
|
+
buildJudgePrompt: () => buildJudgePrompt,
|
|
13639
|
+
aggregateVerdict: () => aggregateVerdict
|
|
13640
|
+
});
|
|
13629
13641
|
import { spawn } from "child_process";
|
|
13630
13642
|
import {
|
|
13631
13643
|
mkdirSync,
|
|
@@ -22224,6 +22236,9 @@ var init_profile_config = __esm(() => {
|
|
|
22224
22236
|
};
|
|
22225
22237
|
});
|
|
22226
22238
|
|
|
22239
|
+
// src/version.ts
|
|
22240
|
+
var VERSION = "6.10.1";
|
|
22241
|
+
|
|
22227
22242
|
// src/telemetry.ts
|
|
22228
22243
|
var exports_telemetry = {};
|
|
22229
22244
|
__export(exports_telemetry, {
|
|
@@ -22240,15 +22255,8 @@ __export(exports_telemetry, {
|
|
|
22240
22255
|
buildReport: () => buildReport
|
|
22241
22256
|
});
|
|
22242
22257
|
import { randomBytes } from "crypto";
|
|
22243
|
-
import { createRequire } from "module";
|
|
22244
22258
|
function getVersion() {
|
|
22245
|
-
|
|
22246
|
-
const require2 = createRequire(import.meta.url);
|
|
22247
|
-
const pkg = require2("../package.json");
|
|
22248
|
-
return pkg.version ?? "unknown";
|
|
22249
|
-
} catch {
|
|
22250
|
-
return "unknown";
|
|
22251
|
-
}
|
|
22259
|
+
return VERSION;
|
|
22252
22260
|
}
|
|
22253
22261
|
function detectRuntime() {
|
|
22254
22262
|
if (process.versions.bun) {
|
|
@@ -23662,15 +23670,8 @@ __export(exports_stats, {
|
|
|
23662
23670
|
handleStatsCommand: () => handleStatsCommand,
|
|
23663
23671
|
flushStats: () => flushStats
|
|
23664
23672
|
});
|
|
23665
|
-
import { createRequire as createRequire2 } from "module";
|
|
23666
23673
|
function getVersion2() {
|
|
23667
|
-
|
|
23668
|
-
const require2 = createRequire2(import.meta.url);
|
|
23669
|
-
const pkg = require2("../package.json");
|
|
23670
|
-
return pkg.version ?? "unknown";
|
|
23671
|
-
} catch {
|
|
23672
|
-
return "unknown";
|
|
23673
|
-
}
|
|
23674
|
+
return VERSION;
|
|
23674
23675
|
}
|
|
23675
23676
|
function detectTimezone() {
|
|
23676
23677
|
try {
|
|
@@ -27618,12 +27619,7 @@ class KimiOAuth {
|
|
|
27618
27619
|
return deviceId;
|
|
27619
27620
|
}
|
|
27620
27621
|
getVersion() {
|
|
27621
|
-
|
|
27622
|
-
const packageJson = JSON.parse(readFileSync13(join18(__dirname, "../../package.json"), "utf-8"));
|
|
27623
|
-
return packageJson.version;
|
|
27624
|
-
} catch {
|
|
27625
|
-
return "4.0.6";
|
|
27626
|
-
}
|
|
27622
|
+
return VERSION;
|
|
27627
27623
|
}
|
|
27628
27624
|
getPlatformHeaders() {
|
|
27629
27625
|
return {
|
|
@@ -27907,7 +27903,7 @@ function hasKimiOAuthCredentials() {
|
|
|
27907
27903
|
return false;
|
|
27908
27904
|
}
|
|
27909
27905
|
}
|
|
27910
|
-
var
|
|
27906
|
+
var execAsync3, OAUTH_CONFIG3;
|
|
27911
27907
|
var init_kimi_oauth = __esm(() => {
|
|
27912
27908
|
init_logger();
|
|
27913
27909
|
execAsync3 = promisify3(exec3);
|
|
@@ -44779,7 +44775,7 @@ async function fetchGLMCodingModels() {
|
|
|
44779
44775
|
return [];
|
|
44780
44776
|
}
|
|
44781
44777
|
}
|
|
44782
|
-
var __filename4, __dirname4,
|
|
44778
|
+
var __filename4, __dirname4, CACHE_MAX_AGE_DAYS2 = 2, CLAUDISH_CACHE_DIR2, BUNDLED_MODELS_PATH, CACHED_MODELS_PATH, ALL_MODELS_JSON_PATH;
|
|
44783
44779
|
var init_cli = __esm(() => {
|
|
44784
44780
|
init_config();
|
|
44785
44781
|
init_model_loader();
|
|
@@ -44791,10 +44787,6 @@ var init_cli = __esm(() => {
|
|
|
44791
44787
|
init_provider_resolver();
|
|
44792
44788
|
__filename4 = fileURLToPath3(import.meta.url);
|
|
44793
44789
|
__dirname4 = dirname3(__filename4);
|
|
44794
|
-
try {
|
|
44795
|
-
const packageJson = JSON.parse(readFileSync19(join23(__dirname4, "../package.json"), "utf-8"));
|
|
44796
|
-
VERSION = packageJson.version;
|
|
44797
|
-
} catch {}
|
|
44798
44790
|
CLAUDISH_CACHE_DIR2 = join23(homedir22(), ".claudish");
|
|
44799
44791
|
BUNDLED_MODELS_PATH = join23(__dirname4, "../recommended-models.json");
|
|
44800
44792
|
CACHED_MODELS_PATH = join23(CLAUDISH_CACHE_DIR2, "recommended-models.json");
|
|
@@ -44809,18 +44801,9 @@ __export(exports_update_checker, {
|
|
|
44809
44801
|
clearCache: () => clearCache,
|
|
44810
44802
|
checkForUpdates: () => checkForUpdates
|
|
44811
44803
|
});
|
|
44812
|
-
import { execSync } from "child_process";
|
|
44813
44804
|
import { existsSync as existsSync22, mkdirSync as mkdirSync12, readFileSync as readFileSync20, unlinkSync as unlinkSync8, writeFileSync as writeFileSync13 } from "fs";
|
|
44814
44805
|
import { homedir as homedir23, platform as platform2, tmpdir } from "os";
|
|
44815
44806
|
import { join as join24 } from "path";
|
|
44816
|
-
import { createInterface as createInterface2 } from "readline";
|
|
44817
|
-
function getUpdateCommand() {
|
|
44818
|
-
const scriptPath = process.argv[1] || "";
|
|
44819
|
-
if (scriptPath.includes("/.bun/")) {
|
|
44820
|
-
return "bun add -g claudish@latest";
|
|
44821
|
-
}
|
|
44822
|
-
return "npm install -g claudish@latest";
|
|
44823
|
-
}
|
|
44824
44807
|
function getCacheFilePath() {
|
|
44825
44808
|
let cacheDir;
|
|
44826
44809
|
if (isWindows) {
|
|
@@ -44903,43 +44886,8 @@ async function fetchLatestVersion() {
|
|
|
44903
44886
|
return null;
|
|
44904
44887
|
}
|
|
44905
44888
|
}
|
|
44906
|
-
function promptUser(question) {
|
|
44907
|
-
return new Promise((resolve3) => {
|
|
44908
|
-
const rl = createInterface2({
|
|
44909
|
-
input: process.stdin,
|
|
44910
|
-
output: process.stderr
|
|
44911
|
-
});
|
|
44912
|
-
rl.question(question, (answer) => {
|
|
44913
|
-
rl.close();
|
|
44914
|
-
const normalized = answer.toLowerCase().trim();
|
|
44915
|
-
resolve3(normalized === "y" || normalized === "yes");
|
|
44916
|
-
});
|
|
44917
|
-
});
|
|
44918
|
-
}
|
|
44919
|
-
function runUpdate() {
|
|
44920
|
-
const command = getUpdateCommand();
|
|
44921
|
-
try {
|
|
44922
|
-
console.error(`
|
|
44923
|
-
[claudish] Updating...
|
|
44924
|
-
`);
|
|
44925
|
-
execSync(command, {
|
|
44926
|
-
stdio: "inherit",
|
|
44927
|
-
shell: process.platform === "win32" ? "cmd.exe" : "/bin/sh"
|
|
44928
|
-
});
|
|
44929
|
-
console.error(`
|
|
44930
|
-
[claudish] Update complete! Please restart claudish.
|
|
44931
|
-
`);
|
|
44932
|
-
return true;
|
|
44933
|
-
} catch (error2) {
|
|
44934
|
-
console.error(`
|
|
44935
|
-
[claudish] Update failed. Try manually:`);
|
|
44936
|
-
console.error(` ${command}
|
|
44937
|
-
`);
|
|
44938
|
-
return false;
|
|
44939
|
-
}
|
|
44940
|
-
}
|
|
44941
44889
|
async function checkForUpdates(currentVersion, options = {}) {
|
|
44942
|
-
const { quiet = false
|
|
44890
|
+
const { quiet = false } = options;
|
|
44943
44891
|
let latestVersion = null;
|
|
44944
44892
|
const cache = readCache();
|
|
44945
44893
|
if (cache && isCacheValid(cache)) {
|
|
@@ -44949,42 +44897,18 @@ async function checkForUpdates(currentVersion, options = {}) {
|
|
|
44949
44897
|
writeCache(latestVersion);
|
|
44950
44898
|
}
|
|
44951
44899
|
if (!latestVersion) {
|
|
44952
|
-
return
|
|
44900
|
+
return;
|
|
44953
44901
|
}
|
|
44954
44902
|
if (compareVersions(latestVersion, currentVersion) <= 0) {
|
|
44955
|
-
return
|
|
44903
|
+
return;
|
|
44956
44904
|
}
|
|
44957
44905
|
if (!quiet) {
|
|
44958
44906
|
console.error("");
|
|
44959
|
-
console.error(
|
|
44960
|
-
console.error(` New version available: ${currentVersion} \u2192 ${latestVersion}`);
|
|
44961
|
-
console.error("\u2501".repeat(60));
|
|
44907
|
+
console.error(` ${CYAN}\u250C${RESET} ${BOLD}Update available:${RESET} ${currentVersion} ${DIM}\u2192${RESET} ${GREEN}${latestVersion}${RESET} ${DIM}Run:${RESET} ${BOLD}${CYAN}claudish update${RESET}`);
|
|
44962
44908
|
console.error("");
|
|
44963
44909
|
}
|
|
44964
|
-
if (skipPrompt) {
|
|
44965
|
-
if (!quiet) {
|
|
44966
|
-
console.error(` Update with: npm install -g claudish@latest
|
|
44967
|
-
`);
|
|
44968
|
-
}
|
|
44969
|
-
return false;
|
|
44970
|
-
}
|
|
44971
|
-
const shouldUpdate = await promptUser(" Would you like to update now? [y/N] ");
|
|
44972
|
-
if (!shouldUpdate) {
|
|
44973
|
-
if (!quiet) {
|
|
44974
|
-
console.error(`
|
|
44975
|
-
Skipped. Update later with: npm install -g claudish@latest
|
|
44976
|
-
`);
|
|
44977
|
-
}
|
|
44978
|
-
return false;
|
|
44979
|
-
}
|
|
44980
|
-
const success = runUpdate();
|
|
44981
|
-
if (success) {
|
|
44982
|
-
clearCache();
|
|
44983
|
-
return true;
|
|
44984
|
-
}
|
|
44985
|
-
return false;
|
|
44986
44910
|
}
|
|
44987
|
-
var isWindows, NPM_REGISTRY_URL = "https://registry.npmjs.org/claudish/latest", CACHE_MAX_AGE_MS;
|
|
44911
|
+
var isWindows, NPM_REGISTRY_URL = "https://registry.npmjs.org/claudish/latest", CACHE_MAX_AGE_MS, RESET = "\x1B[0m", BOLD = "\x1B[1m", GREEN = "\x1B[32m", CYAN = "\x1B[36m", DIM = "\x1B[2m";
|
|
44988
44912
|
var init_update_checker = __esm(() => {
|
|
44989
44913
|
isWindows = platform2() === "win32";
|
|
44990
44914
|
CACHE_MAX_AGE_MS = 24 * 60 * 60 * 1000;
|
|
@@ -44995,8 +44919,7 @@ var exports_update_command = {};
|
|
|
44995
44919
|
__export(exports_update_command, {
|
|
44996
44920
|
updateCommand: () => updateCommand
|
|
44997
44921
|
});
|
|
44998
|
-
import { execSync
|
|
44999
|
-
import { createInterface as createInterface3 } from "readline";
|
|
44922
|
+
import { execSync } from "child_process";
|
|
45000
44923
|
function detectInstallationMethod() {
|
|
45001
44924
|
const scriptPath = process.argv[1] || "";
|
|
45002
44925
|
if (scriptPath.includes("/opt/homebrew/") || scriptPath.includes("/usr/local/Cellar/")) {
|
|
@@ -45010,7 +44933,7 @@ function detectInstallationMethod() {
|
|
|
45010
44933
|
}
|
|
45011
44934
|
return { method: "unknown", path: scriptPath };
|
|
45012
44935
|
}
|
|
45013
|
-
function
|
|
44936
|
+
function getUpdateCommand(method) {
|
|
45014
44937
|
switch (method) {
|
|
45015
44938
|
case "npm":
|
|
45016
44939
|
return "npm install -g claudish@latest";
|
|
@@ -45022,104 +44945,199 @@ function getUpdateCommand2(method) {
|
|
|
45022
44945
|
return "";
|
|
45023
44946
|
}
|
|
45024
44947
|
}
|
|
45025
|
-
function promptUser2(question) {
|
|
45026
|
-
return new Promise((resolve3) => {
|
|
45027
|
-
const rl = createInterface3({
|
|
45028
|
-
input: process.stdin,
|
|
45029
|
-
output: process.stdout
|
|
45030
|
-
});
|
|
45031
|
-
rl.question(question, (answer) => {
|
|
45032
|
-
rl.close();
|
|
45033
|
-
const normalized = answer.toLowerCase().trim();
|
|
45034
|
-
resolve3(normalized === "y" || normalized === "yes" || normalized === "");
|
|
45035
|
-
});
|
|
45036
|
-
});
|
|
45037
|
-
}
|
|
45038
44948
|
async function executeUpdate(command) {
|
|
45039
44949
|
try {
|
|
45040
|
-
|
|
45041
|
-
${BOLD}Updating...${RESET}
|
|
45042
|
-
`);
|
|
45043
|
-
execSync2(command, {
|
|
44950
|
+
execSync(command, {
|
|
45044
44951
|
stdio: "inherit",
|
|
45045
44952
|
shell: process.platform === "win32" ? "cmd.exe" : "/bin/sh"
|
|
45046
44953
|
});
|
|
45047
|
-
console.log(`
|
|
45048
|
-
${GREEN}\u2713${RESET} ${BOLD}Update complete!${RESET}`);
|
|
45049
|
-
console.log(`${CYAN}Please restart any running claudish sessions.${RESET}
|
|
45050
|
-
`);
|
|
45051
44954
|
return true;
|
|
45052
|
-
} catch
|
|
44955
|
+
} catch {
|
|
45053
44956
|
console.error(`
|
|
45054
|
-
${RED2}\u2717${
|
|
45055
|
-
console.error(`${YELLOW}Try manually:${
|
|
44957
|
+
${RED2}\u2717${RESET2} ${BOLD2}Update failed.${RESET2}`);
|
|
44958
|
+
console.error(`${YELLOW}Try manually:${RESET2}`);
|
|
45056
44959
|
console.error(` ${command}
|
|
45057
44960
|
`);
|
|
45058
44961
|
return false;
|
|
45059
44962
|
}
|
|
45060
44963
|
}
|
|
44964
|
+
function parseRelease(r) {
|
|
44965
|
+
const version2 = r.tag_name.replace(/^v/, "");
|
|
44966
|
+
let title = "";
|
|
44967
|
+
const name = r.name || "";
|
|
44968
|
+
const dashMatch = name.match(/\s[\u2014\u2013-]\s(.+)$/);
|
|
44969
|
+
if (dashMatch) {
|
|
44970
|
+
title = dashMatch[1].trim();
|
|
44971
|
+
}
|
|
44972
|
+
const items = [];
|
|
44973
|
+
if (!r.body)
|
|
44974
|
+
return { version: version2, title, items };
|
|
44975
|
+
const lines = r.body.split(`
|
|
44976
|
+
`);
|
|
44977
|
+
let currentType = "feat";
|
|
44978
|
+
for (const line of lines) {
|
|
44979
|
+
if (/^##\s+Install/i.test(line))
|
|
44980
|
+
break;
|
|
44981
|
+
const sectionMatch = line.match(/^###\s+(.+)$/);
|
|
44982
|
+
if (sectionMatch) {
|
|
44983
|
+
const sectionName = sectionMatch[1].trim().toLowerCase();
|
|
44984
|
+
const mapped = SECTION_TYPE_MAP[sectionName];
|
|
44985
|
+
currentType = mapped === undefined ? "chore" : mapped;
|
|
44986
|
+
continue;
|
|
44987
|
+
}
|
|
44988
|
+
if (currentType === null)
|
|
44989
|
+
continue;
|
|
44990
|
+
const bulletMatch = line.match(/^[\s]*[-*]\s+(.+)$/);
|
|
44991
|
+
if (!bulletMatch)
|
|
44992
|
+
continue;
|
|
44993
|
+
let text = bulletMatch[1].trim();
|
|
44994
|
+
text = text.replace(/\(\[`[a-f0-9]+`\]\([^)]*\)\)\s*$/, "").trim();
|
|
44995
|
+
text = text.replace(/^v\d+\.\d+\.\d+\s*[\u2014\u2013-]\s*/, "").trim();
|
|
44996
|
+
if (/^bump\s+to\s+v/i.test(text))
|
|
44997
|
+
continue;
|
|
44998
|
+
if (/^update\s+CHANGELOG/i.test(text))
|
|
44999
|
+
continue;
|
|
45000
|
+
if (!text)
|
|
45001
|
+
continue;
|
|
45002
|
+
items.push({ type: currentType, text });
|
|
45003
|
+
}
|
|
45004
|
+
return { version: version2, title, items };
|
|
45005
|
+
}
|
|
45006
|
+
async function fetchChangelog(currentVersion, latestVersion) {
|
|
45007
|
+
try {
|
|
45008
|
+
const controller = new AbortController;
|
|
45009
|
+
const timeout = setTimeout(() => controller.abort(), 5000);
|
|
45010
|
+
const response = await fetch("https://api.github.com/repos/MadAppGang/claudish/releases", {
|
|
45011
|
+
signal: controller.signal,
|
|
45012
|
+
headers: {
|
|
45013
|
+
Accept: "application/vnd.github+json",
|
|
45014
|
+
"User-Agent": "claudish-updater"
|
|
45015
|
+
}
|
|
45016
|
+
});
|
|
45017
|
+
clearTimeout(timeout);
|
|
45018
|
+
if (!response.ok) {
|
|
45019
|
+
return [];
|
|
45020
|
+
}
|
|
45021
|
+
const releases = await response.json();
|
|
45022
|
+
const relevant = releases.filter((r) => {
|
|
45023
|
+
const ver = r.tag_name.replace(/^v/, "");
|
|
45024
|
+
return compareVersions(ver, currentVersion) > 0 && compareVersions(ver, latestVersion) <= 0;
|
|
45025
|
+
});
|
|
45026
|
+
relevant.sort((a, b) => {
|
|
45027
|
+
const verA = a.tag_name.replace(/^v/, "");
|
|
45028
|
+
const verB = b.tag_name.replace(/^v/, "");
|
|
45029
|
+
return compareVersions(verB, verA);
|
|
45030
|
+
});
|
|
45031
|
+
return relevant.map((r) => parseRelease(r));
|
|
45032
|
+
} catch {
|
|
45033
|
+
return [];
|
|
45034
|
+
}
|
|
45035
|
+
}
|
|
45036
|
+
function itemStyle(type) {
|
|
45037
|
+
switch (type) {
|
|
45038
|
+
case "feat":
|
|
45039
|
+
return { symbol: "\u2726", color: GREEN2 };
|
|
45040
|
+
case "fix":
|
|
45041
|
+
return { symbol: "\u2726", color: YELLOW };
|
|
45042
|
+
case "breaking":
|
|
45043
|
+
return { symbol: "\u2726", color: MAGENTA };
|
|
45044
|
+
case "perf":
|
|
45045
|
+
return { symbol: "\u2726", color: CYAN2 };
|
|
45046
|
+
case "chore":
|
|
45047
|
+
return { symbol: "\u25AA", color: DIM2 };
|
|
45048
|
+
}
|
|
45049
|
+
}
|
|
45050
|
+
function displayChangelog(entries) {
|
|
45051
|
+
if (entries.length === 0) {
|
|
45052
|
+
return;
|
|
45053
|
+
}
|
|
45054
|
+
const innerWidth = 50;
|
|
45055
|
+
const headerLabel = ` ${YELLOW}\u2726${RESET2} ${BOLD2}What's New${RESET2}`;
|
|
45056
|
+
const headerVisible = 14;
|
|
45057
|
+
const headerPad = innerWidth - headerVisible;
|
|
45058
|
+
console.log("");
|
|
45059
|
+
console.log(`${CYAN2}\u250C${"\u2500".repeat(innerWidth + 1)}\u2510${RESET2}`);
|
|
45060
|
+
console.log(`${CYAN2}\u2502${RESET2}${headerLabel}${" ".repeat(headerPad)}${CYAN2}\u2502${RESET2}`);
|
|
45061
|
+
console.log(`${CYAN2}\u2514${"\u2500".repeat(innerWidth + 1)}\u2518${RESET2}`);
|
|
45062
|
+
console.log("");
|
|
45063
|
+
for (const entry of entries) {
|
|
45064
|
+
const titlePart = entry.title ? ` ${entry.title}` : "";
|
|
45065
|
+
console.log(` ${BOLD2}${GREEN2}v${entry.version}${RESET2}${titlePart}`);
|
|
45066
|
+
console.log(` ${DIM2}${"\u2500".repeat(30)}${RESET2}`);
|
|
45067
|
+
for (const item of entry.items) {
|
|
45068
|
+
const { symbol, color } = itemStyle(item.type);
|
|
45069
|
+
console.log(` ${color}${symbol}${RESET2} ${item.text}`);
|
|
45070
|
+
}
|
|
45071
|
+
console.log("");
|
|
45072
|
+
}
|
|
45073
|
+
console.log(`${CYAN2}Please restart any running claudish sessions.${RESET2}`);
|
|
45074
|
+
}
|
|
45061
45075
|
function printManualInstructions() {
|
|
45062
45076
|
console.log(`
|
|
45063
|
-
${
|
|
45064
|
-
console.log(`${YELLOW}Please update manually:${
|
|
45077
|
+
${BOLD2}Unable to detect installation method.${RESET2}`);
|
|
45078
|
+
console.log(`${YELLOW}Please update manually:${RESET2}
|
|
45065
45079
|
`);
|
|
45066
|
-
console.log(` ${
|
|
45067
|
-
console.log(` ${
|
|
45068
|
-
console.log(` ${
|
|
45080
|
+
console.log(` ${CYAN2}npm:${RESET2} npm install -g claudish@latest`);
|
|
45081
|
+
console.log(` ${CYAN2}bun:${RESET2} bun install -g claudish@latest`);
|
|
45082
|
+
console.log(` ${CYAN2}brew:${RESET2} brew upgrade claudish
|
|
45069
45083
|
`);
|
|
45070
45084
|
}
|
|
45071
45085
|
async function updateCommand() {
|
|
45072
45086
|
const currentVersion = getVersion3();
|
|
45073
45087
|
const installInfo = detectInstallationMethod();
|
|
45074
|
-
console.log(`claudish v${currentVersion}`);
|
|
45075
|
-
console.log(`Installation: ${installInfo.method}`);
|
|
45076
|
-
console.log(`
|
|
45077
|
-
${BOLD}Checking for updates...${RESET}
|
|
45078
|
-
`);
|
|
45079
45088
|
const latestVersion = await fetchLatestVersion();
|
|
45080
45089
|
if (!latestVersion) {
|
|
45081
|
-
console.error(`${RED2}\u2717${
|
|
45082
|
-
console.error(`${YELLOW}Please check your internet connection and try again.${
|
|
45090
|
+
console.error(`${RED2}\u2717${RESET2} Unable to fetch latest version from npm registry.`);
|
|
45091
|
+
console.error(`${YELLOW}Please check your internet connection and try again.${RESET2}
|
|
45083
45092
|
`);
|
|
45084
45093
|
process.exit(1);
|
|
45085
45094
|
}
|
|
45086
45095
|
const comparison = compareVersions(latestVersion, currentVersion);
|
|
45087
45096
|
if (comparison <= 0) {
|
|
45088
|
-
console.log(`${
|
|
45089
|
-
console.log(`${
|
|
45097
|
+
console.log(`${GREEN2}\u2713${RESET2} ${BOLD2}Already up-to-date!${RESET2}`);
|
|
45098
|
+
console.log(`${CYAN2}Current version: ${currentVersion}${RESET2}
|
|
45090
45099
|
`);
|
|
45091
45100
|
process.exit(0);
|
|
45092
45101
|
}
|
|
45093
|
-
console.log(
|
|
45094
|
-
console.log(`${BOLD}Latest version:${RESET} ${GREEN}${latestVersion}${RESET}
|
|
45095
|
-
`);
|
|
45102
|
+
console.log(` ${BOLD2}claudish${RESET2} ${YELLOW}v${currentVersion}${RESET2} ${DIM2}\u2192${RESET2} ${GREEN2}v${latestVersion}${RESET2} ${DIM2}(${installInfo.method})${RESET2}`);
|
|
45096
45103
|
if (installInfo.method === "unknown") {
|
|
45097
45104
|
printManualInstructions();
|
|
45098
45105
|
process.exit(1);
|
|
45099
45106
|
}
|
|
45100
|
-
const command =
|
|
45101
|
-
console.log(
|
|
45102
|
-
|
|
45103
|
-
const shouldUpdate = await promptUser2(`${BOLD}Proceed with update? [Y/n]${RESET} `);
|
|
45104
|
-
if (!shouldUpdate) {
|
|
45105
|
-
console.log(`
|
|
45106
|
-
${YELLOW}Update cancelled.${RESET}`);
|
|
45107
|
-
console.log(`${CYAN}Update later with: ${command}${RESET}
|
|
45107
|
+
const command = getUpdateCommand(installInfo.method);
|
|
45108
|
+
console.log(`
|
|
45109
|
+
${DIM2}Updating...${RESET2}
|
|
45108
45110
|
`);
|
|
45109
|
-
process.exit(0);
|
|
45110
|
-
}
|
|
45111
45111
|
const success = await executeUpdate(command);
|
|
45112
45112
|
if (success) {
|
|
45113
|
+
console.log(`
|
|
45114
|
+
${GREEN2}\u2713${RESET2} ${BOLD2}Updated successfully${RESET2}`);
|
|
45113
45115
|
clearCache();
|
|
45116
|
+
const changelog = await fetchChangelog(currentVersion, latestVersion);
|
|
45117
|
+
displayChangelog(changelog);
|
|
45118
|
+
console.log("");
|
|
45114
45119
|
process.exit(0);
|
|
45115
45120
|
} else {
|
|
45116
45121
|
process.exit(1);
|
|
45117
45122
|
}
|
|
45118
45123
|
}
|
|
45119
|
-
var
|
|
45124
|
+
var RESET2 = "\x1B[0m", BOLD2 = "\x1B[1m", GREEN2 = "\x1B[32m", YELLOW = "\x1B[33m", CYAN2 = "\x1B[36m", RED2 = "\x1B[31m", MAGENTA = "\x1B[35m", DIM2 = "\x1B[2m", SECTION_TYPE_MAP;
|
|
45120
45125
|
var init_update_command = __esm(() => {
|
|
45121
45126
|
init_cli();
|
|
45122
45127
|
init_update_checker();
|
|
45128
|
+
SECTION_TYPE_MAP = {
|
|
45129
|
+
"new features": "feat",
|
|
45130
|
+
features: "feat",
|
|
45131
|
+
"bug fixes": "fix",
|
|
45132
|
+
fixes: "fix",
|
|
45133
|
+
"breaking changes": "breaking",
|
|
45134
|
+
performance: "perf",
|
|
45135
|
+
"other changes": "chore",
|
|
45136
|
+
chore: "chore",
|
|
45137
|
+
refactor: "chore",
|
|
45138
|
+
documentation: null,
|
|
45139
|
+
docs: null
|
|
45140
|
+
};
|
|
45123
45141
|
});
|
|
45124
45142
|
|
|
45125
45143
|
// src/model-selector.ts
|
|
@@ -46561,16 +46579,16 @@ async function resolveScope(scopeFlag) {
|
|
|
46561
46579
|
}
|
|
46562
46580
|
function scopeBadge(scope, shadowed) {
|
|
46563
46581
|
if (scope === "local") {
|
|
46564
|
-
return `${
|
|
46582
|
+
return `${MAGENTA2}[local]${RESET3}`;
|
|
46565
46583
|
}
|
|
46566
46584
|
if (shadowed) {
|
|
46567
|
-
return `${
|
|
46585
|
+
return `${DIM3}[global, shadowed]${RESET3}`;
|
|
46568
46586
|
}
|
|
46569
|
-
return `${
|
|
46587
|
+
return `${DIM3}[global]${RESET3}`;
|
|
46570
46588
|
}
|
|
46571
46589
|
async function initCommand(scopeFlag) {
|
|
46572
46590
|
console.log(`
|
|
46573
|
-
${
|
|
46591
|
+
${BOLD3}${CYAN3}Claudish Setup Wizard${RESET3}
|
|
46574
46592
|
`);
|
|
46575
46593
|
const scope = await resolveScope(scopeFlag);
|
|
46576
46594
|
const configPath = getConfigPathForScope(scope);
|
|
@@ -46584,27 +46602,27 @@ ${BOLD2}${CYAN2}Claudish Setup Wizard${RESET2}
|
|
|
46584
46602
|
return;
|
|
46585
46603
|
}
|
|
46586
46604
|
}
|
|
46587
|
-
console.log(`${
|
|
46605
|
+
console.log(`${DIM3}This wizard will help you set up Claudish with your preferred models.${RESET3}
|
|
46588
46606
|
`);
|
|
46589
46607
|
const profileName = "default";
|
|
46590
|
-
console.log(`${
|
|
46591
|
-
console.log(`${
|
|
46608
|
+
console.log(`${BOLD3}Step 1: Select models for each Claude tier${RESET3}`);
|
|
46609
|
+
console.log(`${DIM3}These models will be used when Claude Code requests specific model types.${RESET3}
|
|
46592
46610
|
`);
|
|
46593
46611
|
const models = await selectModelsForProfile();
|
|
46594
46612
|
const profile = createProfile(profileName, models, undefined, scope);
|
|
46595
46613
|
setDefaultProfile(profileName, scope);
|
|
46596
46614
|
console.log(`
|
|
46597
|
-
${
|
|
46615
|
+
${GREEN3}\u2713${RESET3} Configuration saved to: ${CYAN3}${configPath}${RESET3}`);
|
|
46598
46616
|
console.log(`
|
|
46599
|
-
${
|
|
46617
|
+
${BOLD3}Profile created:${RESET3}`);
|
|
46600
46618
|
printProfile(profile, true, false, scope);
|
|
46601
46619
|
console.log(`
|
|
46602
|
-
${
|
|
46603
|
-
console.log(` ${
|
|
46604
|
-
console.log(` ${
|
|
46620
|
+
${BOLD3}Usage:${RESET3}`);
|
|
46621
|
+
console.log(` ${CYAN3}claudish${RESET3} # Use default profile`);
|
|
46622
|
+
console.log(` ${CYAN3}claudish profile add${RESET3} # Add another profile`);
|
|
46605
46623
|
if (scope === "local") {
|
|
46606
46624
|
console.log(`
|
|
46607
|
-
${
|
|
46625
|
+
${DIM3}Local config applies only when running from this directory.${RESET3}`);
|
|
46608
46626
|
}
|
|
46609
46627
|
console.log("");
|
|
46610
46628
|
}
|
|
@@ -46620,11 +46638,11 @@ async function profileListCommand(scopeFilter) {
|
|
|
46620
46638
|
return;
|
|
46621
46639
|
}
|
|
46622
46640
|
console.log(`
|
|
46623
|
-
${
|
|
46641
|
+
${BOLD3}Claudish Profiles${RESET3}
|
|
46624
46642
|
`);
|
|
46625
|
-
console.log(`${
|
|
46643
|
+
console.log(`${DIM3}Global: ${getConfigPath()}${RESET3}`);
|
|
46626
46644
|
if (localConfigExists()) {
|
|
46627
|
-
console.log(`${
|
|
46645
|
+
console.log(`${DIM3}Local: ${getLocalConfigPath()}${RESET3}`);
|
|
46628
46646
|
}
|
|
46629
46647
|
console.log("");
|
|
46630
46648
|
for (const profile of profiles) {
|
|
@@ -46634,19 +46652,19 @@ ${BOLD2}Claudish Profiles${RESET2}
|
|
|
46634
46652
|
}
|
|
46635
46653
|
async function profileAddCommand(scopeFlag) {
|
|
46636
46654
|
console.log(`
|
|
46637
|
-
${
|
|
46655
|
+
${BOLD3}${CYAN3}Add New Profile${RESET3}
|
|
46638
46656
|
`);
|
|
46639
46657
|
const scope = await resolveScope(scopeFlag);
|
|
46640
46658
|
const existingNames = getProfileNames(scope);
|
|
46641
46659
|
const name = await promptForProfileName(existingNames);
|
|
46642
46660
|
const description = await promptForProfileDescription();
|
|
46643
46661
|
console.log(`
|
|
46644
|
-
${
|
|
46662
|
+
${BOLD3}Select models for this profile:${RESET3}
|
|
46645
46663
|
`);
|
|
46646
46664
|
const models = await selectModelsForProfile();
|
|
46647
46665
|
const profile = createProfile(name, models, description, scope);
|
|
46648
46666
|
console.log(`
|
|
46649
|
-
${
|
|
46667
|
+
${GREEN3}\u2713${RESET3} Profile "${name}" created ${scopeBadge(scope)}.`);
|
|
46650
46668
|
printProfile(profile, false, false, scope);
|
|
46651
46669
|
const setAsDefault = await dist_default4({
|
|
46652
46670
|
message: `Set this profile as default in ${scope} config?`,
|
|
@@ -46654,7 +46672,7 @@ ${GREEN2}\u2713${RESET2} Profile "${name}" created ${scopeBadge(scope)}.`);
|
|
|
46654
46672
|
});
|
|
46655
46673
|
if (setAsDefault) {
|
|
46656
46674
|
setDefaultProfile(name, scope);
|
|
46657
|
-
console.log(`${
|
|
46675
|
+
console.log(`${GREEN3}\u2713${RESET3} "${name}" is now the default ${scope} profile.`);
|
|
46658
46676
|
}
|
|
46659
46677
|
}
|
|
46660
46678
|
async function profileRemoveCommand(name, scopeFlag) {
|
|
@@ -46670,7 +46688,7 @@ async function profileRemoveCommand(name, scopeFlag) {
|
|
|
46670
46688
|
const choice = await dist_default11({
|
|
46671
46689
|
message: "Select a profile to remove:",
|
|
46672
46690
|
choices: selectable.map((p) => ({
|
|
46673
|
-
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${
|
|
46691
|
+
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${RESET3}` : ""}`,
|
|
46674
46692
|
value: `${p.scope}:${p.name}`
|
|
46675
46693
|
}))
|
|
46676
46694
|
});
|
|
@@ -46718,7 +46736,7 @@ async function profileRemoveCommand(name, scopeFlag) {
|
|
|
46718
46736
|
}
|
|
46719
46737
|
try {
|
|
46720
46738
|
deleteProfile(profileName, scope);
|
|
46721
|
-
console.log(`${
|
|
46739
|
+
console.log(`${GREEN3}\u2713${RESET3} Profile "${profileName}" deleted from ${scope} config.`);
|
|
46722
46740
|
} catch (error2) {
|
|
46723
46741
|
console.error(`Error: ${error2}`);
|
|
46724
46742
|
}
|
|
@@ -46736,7 +46754,7 @@ async function profileUseCommand(name, scopeFlag) {
|
|
|
46736
46754
|
const choice = await dist_default11({
|
|
46737
46755
|
message: "Select a profile to set as default:",
|
|
46738
46756
|
choices: selectable.map((p) => ({
|
|
46739
|
-
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${
|
|
46757
|
+
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${RESET3}` : ""}`,
|
|
46740
46758
|
value: `${p.scope}:${p.name}`
|
|
46741
46759
|
}))
|
|
46742
46760
|
});
|
|
@@ -46772,7 +46790,7 @@ async function profileUseCommand(name, scopeFlag) {
|
|
|
46772
46790
|
return;
|
|
46773
46791
|
}
|
|
46774
46792
|
setDefaultProfile(profileName, scope);
|
|
46775
|
-
console.log(`${
|
|
46793
|
+
console.log(`${GREEN3}\u2713${RESET3} "${profileName}" is now the default ${scope} profile.`);
|
|
46776
46794
|
}
|
|
46777
46795
|
async function profileShowCommand(name, scopeFlag) {
|
|
46778
46796
|
let profileName = name;
|
|
@@ -46826,7 +46844,7 @@ async function profileEditCommand(name, scopeFlag) {
|
|
|
46826
46844
|
const choice = await dist_default11({
|
|
46827
46845
|
message: "Select a profile to edit:",
|
|
46828
46846
|
choices: selectable.map((p) => ({
|
|
46829
|
-
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${
|
|
46847
|
+
name: `${p.name} ${scopeBadge(p.scope)}${p.isDefault ? ` ${YELLOW2}(default)${RESET3}` : ""}`,
|
|
46830
46848
|
value: `${p.scope}:${p.name}`
|
|
46831
46849
|
}))
|
|
46832
46850
|
});
|
|
@@ -46861,9 +46879,9 @@ async function profileEditCommand(name, scopeFlag) {
|
|
|
46861
46879
|
return;
|
|
46862
46880
|
}
|
|
46863
46881
|
console.log(`
|
|
46864
|
-
${
|
|
46882
|
+
${BOLD3}Editing profile: ${profileName}${RESET3} ${scopeBadge(scope)}
|
|
46865
46883
|
`);
|
|
46866
|
-
console.log(`${
|
|
46884
|
+
console.log(`${DIM3}Current models:${RESET3}`);
|
|
46867
46885
|
printModelMapping(profile.models);
|
|
46868
46886
|
console.log("");
|
|
46869
46887
|
const whatToEdit = await dist_default11({
|
|
@@ -46885,14 +46903,14 @@ ${BOLD2}Editing profile: ${profileName}${RESET2} ${scopeBadge(scope)}
|
|
|
46885
46903
|
const newDescription = await promptForProfileDescription();
|
|
46886
46904
|
profile.description = newDescription;
|
|
46887
46905
|
setProfile(profile, scope);
|
|
46888
|
-
console.log(`${
|
|
46906
|
+
console.log(`${GREEN3}\u2713${RESET3} Description updated.`);
|
|
46889
46907
|
return;
|
|
46890
46908
|
}
|
|
46891
46909
|
if (whatToEdit === "all") {
|
|
46892
46910
|
const models = await selectModelsForProfile();
|
|
46893
46911
|
profile.models = { ...profile.models, ...models };
|
|
46894
46912
|
setProfile(profile, scope);
|
|
46895
|
-
console.log(`${
|
|
46913
|
+
console.log(`${GREEN3}\u2713${RESET3} All models updated.`);
|
|
46896
46914
|
return;
|
|
46897
46915
|
}
|
|
46898
46916
|
const tier = whatToEdit;
|
|
@@ -46902,39 +46920,39 @@ ${BOLD2}Editing profile: ${profileName}${RESET2} ${scopeBadge(scope)}
|
|
|
46902
46920
|
});
|
|
46903
46921
|
profile.models[tier] = newModel;
|
|
46904
46922
|
setProfile(profile, scope);
|
|
46905
|
-
console.log(`${
|
|
46923
|
+
console.log(`${GREEN3}\u2713${RESET3} ${tierName} model updated to: ${newModel}`);
|
|
46906
46924
|
}
|
|
46907
46925
|
function printProfile(profile, isDefault, verbose = false, scope) {
|
|
46908
|
-
const defaultBadge = isDefault ? ` ${YELLOW2}(default)${
|
|
46926
|
+
const defaultBadge = isDefault ? ` ${YELLOW2}(default)${RESET3}` : "";
|
|
46909
46927
|
const scopeTag = scope ? ` ${scopeBadge(scope)}` : "";
|
|
46910
|
-
console.log(`${
|
|
46928
|
+
console.log(`${BOLD3}${profile.name}${RESET3}${defaultBadge}${scopeTag}`);
|
|
46911
46929
|
if (profile.description) {
|
|
46912
|
-
console.log(` ${
|
|
46930
|
+
console.log(` ${DIM3}${profile.description}${RESET3}`);
|
|
46913
46931
|
}
|
|
46914
46932
|
printModelMapping(profile.models);
|
|
46915
46933
|
if (verbose) {
|
|
46916
|
-
console.log(` ${
|
|
46917
|
-
console.log(` ${
|
|
46934
|
+
console.log(` ${DIM3}Created: ${profile.createdAt}${RESET3}`);
|
|
46935
|
+
console.log(` ${DIM3}Updated: ${profile.updatedAt}${RESET3}`);
|
|
46918
46936
|
}
|
|
46919
46937
|
}
|
|
46920
46938
|
function printProfileWithScope(profile) {
|
|
46921
|
-
const defaultBadge = profile.isDefault ? ` ${YELLOW2}(default)${
|
|
46939
|
+
const defaultBadge = profile.isDefault ? ` ${YELLOW2}(default)${RESET3}` : "";
|
|
46922
46940
|
const badge = scopeBadge(profile.scope, profile.shadowed);
|
|
46923
|
-
console.log(`${
|
|
46941
|
+
console.log(`${BOLD3}${profile.name}${RESET3}${defaultBadge} ${badge}`);
|
|
46924
46942
|
if (profile.shadowed) {
|
|
46925
|
-
console.log(` ${
|
|
46943
|
+
console.log(` ${DIM3}(overridden by local profile of same name)${RESET3}`);
|
|
46926
46944
|
}
|
|
46927
46945
|
if (profile.description) {
|
|
46928
|
-
console.log(` ${
|
|
46946
|
+
console.log(` ${DIM3}${profile.description}${RESET3}`);
|
|
46929
46947
|
}
|
|
46930
46948
|
printModelMapping(profile.models);
|
|
46931
46949
|
}
|
|
46932
46950
|
function printModelMapping(models) {
|
|
46933
|
-
console.log(` ${
|
|
46934
|
-
console.log(` ${
|
|
46935
|
-
console.log(` ${
|
|
46951
|
+
console.log(` ${CYAN3}opus${RESET3}: ${models.opus || DIM3 + "not set" + RESET3}`);
|
|
46952
|
+
console.log(` ${CYAN3}sonnet${RESET3}: ${models.sonnet || DIM3 + "not set" + RESET3}`);
|
|
46953
|
+
console.log(` ${CYAN3}haiku${RESET3}: ${models.haiku || DIM3 + "not set" + RESET3}`);
|
|
46936
46954
|
if (models.subagent) {
|
|
46937
|
-
console.log(` ${
|
|
46955
|
+
console.log(` ${CYAN3}subagent${RESET3}: ${models.subagent}`);
|
|
46938
46956
|
}
|
|
46939
46957
|
}
|
|
46940
46958
|
async function profileCommand(args) {
|
|
@@ -46974,22 +46992,22 @@ async function profileCommand(args) {
|
|
|
46974
46992
|
}
|
|
46975
46993
|
function printProfileHelp() {
|
|
46976
46994
|
console.log(`
|
|
46977
|
-
${
|
|
46978
|
-
|
|
46979
|
-
${
|
|
46980
|
-
${
|
|
46981
|
-
${
|
|
46982
|
-
${
|
|
46983
|
-
${
|
|
46984
|
-
${
|
|
46985
|
-
${
|
|
46986
|
-
|
|
46987
|
-
${
|
|
46988
|
-
${
|
|
46989
|
-
${
|
|
46990
|
-
${
|
|
46991
|
-
|
|
46992
|
-
${
|
|
46995
|
+
${BOLD3}Usage:${RESET3} claudish profile <command> [options]
|
|
46996
|
+
|
|
46997
|
+
${BOLD3}Commands:${RESET3}
|
|
46998
|
+
${CYAN3}list${RESET3}, ${CYAN3}ls${RESET3} List all profiles
|
|
46999
|
+
${CYAN3}add${RESET3}, ${CYAN3}new${RESET3} Add a new profile
|
|
47000
|
+
${CYAN3}remove${RESET3} ${DIM3}[name]${RESET3} Remove a profile
|
|
47001
|
+
${CYAN3}use${RESET3} ${DIM3}[name]${RESET3} Set default profile
|
|
47002
|
+
${CYAN3}show${RESET3} ${DIM3}[name]${RESET3} Show profile details
|
|
47003
|
+
${CYAN3}edit${RESET3} ${DIM3}[name]${RESET3} Edit a profile
|
|
47004
|
+
|
|
47005
|
+
${BOLD3}Scope Flags:${RESET3}
|
|
47006
|
+
${CYAN3}--local${RESET3} Target .claudish.json in the current directory
|
|
47007
|
+
${CYAN3}--global${RESET3} Target ~/.claudish/config.json (default)
|
|
47008
|
+
${DIM3}If neither flag is given, you'll be prompted interactively.${RESET3}
|
|
47009
|
+
|
|
47010
|
+
${BOLD3}Examples:${RESET3}
|
|
46993
47011
|
claudish profile list
|
|
46994
47012
|
claudish profile list --local
|
|
46995
47013
|
claudish profile add --local
|
|
@@ -46999,7 +47017,7 @@ ${BOLD2}Examples:${RESET2}
|
|
|
46999
47017
|
claudish init --local
|
|
47000
47018
|
`);
|
|
47001
47019
|
}
|
|
47002
|
-
var
|
|
47020
|
+
var RESET3 = "\x1B[0m", BOLD3 = "\x1B[1m", DIM3 = "\x1B[2m", GREEN3 = "\x1B[32m", YELLOW2 = "\x1B[33m", CYAN3 = "\x1B[36m", MAGENTA2 = "\x1B[35m";
|
|
47003
47021
|
var init_profile_commands = __esm(() => {
|
|
47004
47022
|
init_profile_config();
|
|
47005
47023
|
init_model_selector();
|
|
@@ -106100,15 +106118,15 @@ function createTempSettingsFile(modelDisplay, port) {
|
|
|
106100
106118
|
const scriptPath = createStatusLineScript(tokenFilePath);
|
|
106101
106119
|
statusCommand = `node "${scriptPath}"`;
|
|
106102
106120
|
} else {
|
|
106103
|
-
const
|
|
106121
|
+
const CYAN4 = "\\033[96m";
|
|
106104
106122
|
const YELLOW3 = "\\033[93m";
|
|
106105
|
-
const
|
|
106106
|
-
const
|
|
106107
|
-
const
|
|
106108
|
-
const
|
|
106109
|
-
const
|
|
106123
|
+
const GREEN4 = "\\033[92m";
|
|
106124
|
+
const MAGENTA3 = "\\033[95m";
|
|
106125
|
+
const DIM4 = "\\033[2m";
|
|
106126
|
+
const RESET4 = "\\033[0m";
|
|
106127
|
+
const BOLD4 = "\\033[1m";
|
|
106110
106128
|
const formatTokensBash = `fmt_tok() { local n=\${1:-0}; if [ "$n" -ge 1000000 ]; then echo "$((n/1000000))M"; elif [ "$n" -ge 1000 ]; then echo "$((n/1000))k"; else echo "$n"; fi; }`;
|
|
106111
|
-
statusCommand = `JSON=$(cat) && DIR=$(basename "$(pwd)") && [ \${#DIR} -gt 15 ] && DIR="\${DIR:0:12}..." || true && CTX=100 && COST="0" && IS_FREE="false" && IS_EST="false" && PROVIDER="" && TOKEN_MODEL="" && IN_TOK=0 && CTX_WIN=0 && ${formatTokensBash} && if [ -f "${tokenFilePath}" ]; then TOKENS=$(cat "${tokenFilePath}" 2>/dev/null | tr -d ' \\n') && REAL_CTX=$(echo "$TOKENS" | grep -o '"context_left_percent":[0-9]*' | grep -o '[0-9]*') && if [ ! -z "$REAL_CTX" ]; then CTX="$REAL_CTX"; fi && REAL_COST=$(echo "$TOKENS" | grep -o '"total_cost":[0-9.]*' | cut -d: -f2) && if [ ! -z "$REAL_COST" ]; then COST="$REAL_COST"; fi && IN_TOK=$(echo "$TOKENS" | grep -o '"input_tokens":[0-9]*' | grep -o '[0-9]*') && CTX_WIN=$(echo "$TOKENS" | grep -o '"context_window":[0-9]*' | grep -o '[0-9]*') && IS_FREE=$(echo "$TOKENS" | grep -o '"is_free":[a-z]*' | cut -d: -f2) && IS_EST=$(echo "$TOKENS" | grep -o '"is_estimated":[a-z]*' | cut -d: -f2) && PROVIDER=$(echo "$TOKENS" | grep -o '"provider_name":"[^"]*"' | cut -d'"' -f4) && TOKEN_MODEL=$(echo "$TOKENS" | grep -o '"model_name":"[^"]*"' | cut -d'"' -f4); fi && if [ "$CLAUDISH_IS_LOCAL" = "true" ]; then COST_DISPLAY="LOCAL"; elif [ "$IS_FREE" = "true" ]; then COST_DISPLAY="FREE"; elif [ "$IS_EST" = "true" ]; then COST_DISPLAY=$(printf "~\\$%.3f" "$COST"); else COST_DISPLAY=$(printf "\\$%.3f" "$COST"); fi && MODEL_DISPLAY="\${TOKEN_MODEL:-$CLAUDISH_ACTIVE_MODEL_NAME}" && if [ ! -z "$PROVIDER" ]; then MODEL_DISPLAY="$PROVIDER $MODEL_DISPLAY"; fi && if [ "$IN_TOK" -gt 0 ] 2>/dev/null && [ "$CTX_WIN" -gt 0 ] 2>/dev/null; then CTX_DISPLAY="$CTX% ($(fmt_tok $IN_TOK)/$(fmt_tok $CTX_WIN))"; else CTX_DISPLAY="$CTX%"; fi && printf "${
|
|
106129
|
+
statusCommand = `JSON=$(cat) && DIR=$(basename "$(pwd)") && [ \${#DIR} -gt 15 ] && DIR="\${DIR:0:12}..." || true && CTX=100 && COST="0" && IS_FREE="false" && IS_EST="false" && PROVIDER="" && TOKEN_MODEL="" && IN_TOK=0 && CTX_WIN=0 && ${formatTokensBash} && if [ -f "${tokenFilePath}" ]; then TOKENS=$(cat "${tokenFilePath}" 2>/dev/null | tr -d ' \\n') && REAL_CTX=$(echo "$TOKENS" | grep -o '"context_left_percent":[0-9]*' | grep -o '[0-9]*') && if [ ! -z "$REAL_CTX" ]; then CTX="$REAL_CTX"; fi && REAL_COST=$(echo "$TOKENS" | grep -o '"total_cost":[0-9.]*' | cut -d: -f2) && if [ ! -z "$REAL_COST" ]; then COST="$REAL_COST"; fi && IN_TOK=$(echo "$TOKENS" | grep -o '"input_tokens":[0-9]*' | grep -o '[0-9]*') && CTX_WIN=$(echo "$TOKENS" | grep -o '"context_window":[0-9]*' | grep -o '[0-9]*') && IS_FREE=$(echo "$TOKENS" | grep -o '"is_free":[a-z]*' | cut -d: -f2) && IS_EST=$(echo "$TOKENS" | grep -o '"is_estimated":[a-z]*' | cut -d: -f2) && PROVIDER=$(echo "$TOKENS" | grep -o '"provider_name":"[^"]*"' | cut -d'"' -f4) && TOKEN_MODEL=$(echo "$TOKENS" | grep -o '"model_name":"[^"]*"' | cut -d'"' -f4); fi && if [ "$CLAUDISH_IS_LOCAL" = "true" ]; then COST_DISPLAY="LOCAL"; elif [ "$IS_FREE" = "true" ]; then COST_DISPLAY="FREE"; elif [ "$IS_EST" = "true" ]; then COST_DISPLAY=$(printf "~\\$%.3f" "$COST"); else COST_DISPLAY=$(printf "\\$%.3f" "$COST"); fi && MODEL_DISPLAY="\${TOKEN_MODEL:-$CLAUDISH_ACTIVE_MODEL_NAME}" && if [ ! -z "$PROVIDER" ]; then MODEL_DISPLAY="$PROVIDER $MODEL_DISPLAY"; fi && if [ "$IN_TOK" -gt 0 ] 2>/dev/null && [ "$CTX_WIN" -gt 0 ] 2>/dev/null; then CTX_DISPLAY="$CTX% ($(fmt_tok $IN_TOK)/$(fmt_tok $CTX_WIN))"; else CTX_DISPLAY="$CTX%"; fi && printf "${CYAN4}${BOLD4}%s${RESET4} ${DIM4}\u2022${RESET4} ${YELLOW3}%s${RESET4} ${DIM4}\u2022${RESET4} ${GREEN4}%s${RESET4} ${DIM4}\u2022${RESET4} ${MAGENTA3}%s${RESET4}\\n" "$DIR" "$MODEL_DISPLAY" "$COST_DISPLAY" "$CTX_DISPLAY"`;
|
|
106112
106130
|
}
|
|
106113
106131
|
const statusLine = {
|
|
106114
106132
|
type: "command",
|
|
@@ -106428,7 +106446,7 @@ import {
|
|
|
106428
106446
|
} from "fs";
|
|
106429
106447
|
import { dirname as dirname6, join as join29 } from "path";
|
|
106430
106448
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
106431
|
-
import { execSync as
|
|
106449
|
+
import { execSync as execSync2 } from "child_process";
|
|
106432
106450
|
function formatElapsed(ms) {
|
|
106433
106451
|
const s = Math.floor(ms / 1000);
|
|
106434
106452
|
if (s < 60)
|
|
@@ -106463,7 +106481,7 @@ function findMagmuxBinary() {
|
|
|
106463
106481
|
}
|
|
106464
106482
|
} catch {}
|
|
106465
106483
|
try {
|
|
106466
|
-
const result =
|
|
106484
|
+
const result = execSync2("which magmux", { encoding: "utf-8" }).trim();
|
|
106467
106485
|
if (result)
|
|
106468
106486
|
return result;
|
|
106469
106487
|
} catch {}
|
|
@@ -106791,7 +106809,6 @@ async function runCli() {
|
|
|
106791
106809
|
try {
|
|
106792
106810
|
const cliConfig = await parseArgs2(process.argv.slice(2));
|
|
106793
106811
|
if (cliConfig.team && cliConfig.team.length > 0) {
|
|
106794
|
-
const { runWithGrid: runWithGrid2 } = await Promise.resolve().then(() => (init_team_grid(), exports_team_grid));
|
|
106795
106812
|
let prompt = cliConfig.claudeArgs.join(" ");
|
|
106796
106813
|
if (cliConfig.inputFile) {
|
|
106797
106814
|
prompt = readFileSync24(cliConfig.inputFile, "utf-8");
|
|
@@ -106800,11 +106817,38 @@ async function runCli() {
|
|
|
106800
106817
|
console.error("Error: --team requires a prompt (positional args or -f <file>)");
|
|
106801
106818
|
process.exit(1);
|
|
106802
106819
|
}
|
|
106803
|
-
const
|
|
106820
|
+
const mode = cliConfig.teamMode ?? "default";
|
|
106804
106821
|
const sessionPath = join30(process.cwd(), `.claudish-team-${Date.now()}`);
|
|
106822
|
+
if (mode === "json") {
|
|
106823
|
+
const { setupSession: setupSession2, runModels: runModels2 } = await Promise.resolve().then(() => (init_team_orchestrator(), exports_team_orchestrator));
|
|
106824
|
+
setupSession2(sessionPath, cliConfig.team, prompt);
|
|
106825
|
+
const status2 = await runModels2(sessionPath, {
|
|
106826
|
+
timeout: 300,
|
|
106827
|
+
claudeFlags: ["--json"]
|
|
106828
|
+
});
|
|
106829
|
+
const result = { ...status2, responses: {} };
|
|
106830
|
+
for (const anonId of Object.keys(status2.models)) {
|
|
106831
|
+
const responsePath = join30(sessionPath, `response-${anonId}.md`);
|
|
106832
|
+
try {
|
|
106833
|
+
const raw2 = readFileSync24(responsePath, "utf-8").trim();
|
|
106834
|
+
try {
|
|
106835
|
+
result.responses[anonId] = JSON.parse(raw2);
|
|
106836
|
+
} catch {
|
|
106837
|
+
result.responses[anonId] = raw2;
|
|
106838
|
+
}
|
|
106839
|
+
} catch {
|
|
106840
|
+
result.responses[anonId] = null;
|
|
106841
|
+
}
|
|
106842
|
+
}
|
|
106843
|
+
console.log(JSON.stringify(result, null, 2));
|
|
106844
|
+
process.exit(0);
|
|
106845
|
+
}
|
|
106846
|
+
const { runWithGrid: runWithGrid2 } = await Promise.resolve().then(() => (init_team_grid(), exports_team_grid));
|
|
106847
|
+
const keep = cliConfig.teamKeep ?? false;
|
|
106805
106848
|
const status = await runWithGrid2(sessionPath, cliConfig.team, prompt, {
|
|
106806
106849
|
timeout: 300,
|
|
106807
|
-
keep
|
|
106850
|
+
keep,
|
|
106851
|
+
mode
|
|
106808
106852
|
});
|
|
106809
106853
|
const modelIds = Object.keys(status.models).sort();
|
|
106810
106854
|
console.log(`
|
|
@@ -106823,7 +106867,7 @@ Team Status`);
|
|
|
106823
106867
|
try {
|
|
106824
106868
|
const cfg = loadConfig2();
|
|
106825
106869
|
if (!cfg.autoApproveConfirmedAt) {
|
|
106826
|
-
const { createInterface:
|
|
106870
|
+
const { createInterface: createInterface2 } = await import("readline");
|
|
106827
106871
|
process.stderr.write(`
|
|
106828
106872
|
[claudish] Auto-approve is enabled by default.
|
|
106829
106873
|
This skips Claude Code permission prompts for tools like Bash, Read, Write.
|
|
@@ -106831,7 +106875,7 @@ Team Status`);
|
|
|
106831
106875
|
|
|
106832
106876
|
`);
|
|
106833
106877
|
const answer = await new Promise((resolve4) => {
|
|
106834
|
-
const rl =
|
|
106878
|
+
const rl = createInterface2({ input: process.stdin, output: process.stderr });
|
|
106835
106879
|
rl.question("Enable auto-approve? [Y/n] ", (ans) => {
|
|
106836
106880
|
rl.close();
|
|
106837
106881
|
resolve4(ans.trim().toLowerCase());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudish",
|
|
3
|
-
"version": "6.10.
|
|
3
|
+
"version": "6.10.1",
|
|
4
4
|
"description": "Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"dev:grok": "bun run src/index.ts --interactive --model x-ai/grok-code-fast-1",
|
|
14
14
|
"dev:grok:debug": "bun run src/index.ts --interactive --debug --log-level info --model x-ai/grok-code-fast-1",
|
|
15
15
|
"dev:info": "bun run src/index.ts --interactive --monitor",
|
|
16
|
-
"build": "bun build src/index.ts --outdir dist --target bun && chmod +x dist/index.js",
|
|
17
|
-
"build:binary": "bun build src/index.ts --compile --outfile claudish",
|
|
16
|
+
"build": "bun run scripts/generate-version.ts && bun build src/index.ts --outdir dist --target bun && chmod +x dist/index.js",
|
|
17
|
+
"build:binary": "bun run scripts/generate-version.ts && bun build src/index.ts --compile --outfile claudish",
|
|
18
18
|
"typecheck": "tsc --noEmit",
|
|
19
19
|
"lint": "biome check .",
|
|
20
20
|
"format": "biome format --write .",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"ai"
|
|
60
60
|
],
|
|
61
61
|
"optionalDependencies": {
|
|
62
|
-
"@claudish/magmux-darwin-arm64": "6.10.
|
|
63
|
-
"@claudish/magmux-darwin-x64": "6.10.
|
|
64
|
-
"@claudish/magmux-linux-arm64": "6.10.
|
|
65
|
-
"@claudish/magmux-linux-x64": "6.10.
|
|
62
|
+
"@claudish/magmux-darwin-arm64": "6.10.1",
|
|
63
|
+
"@claudish/magmux-darwin-x64": "6.10.1",
|
|
64
|
+
"@claudish/magmux-linux-arm64": "6.10.1",
|
|
65
|
+
"@claudish/magmux-linux-x64": "6.10.1"
|
|
66
66
|
},
|
|
67
67
|
"author": "Jack Rudenko <i@madappgang.com>",
|
|
68
68
|
"license": "MIT",
|