@piceofpentogramm/alterclaude 0.1.3 → 0.1.5
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/cli.mjs +56 -15
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -110692,9 +110692,19 @@ class OpenAIShimMessages {
|
|
|
110692
110692
|
...this.defaultHeaders,
|
|
110693
110693
|
...options?.headers ?? {}
|
|
110694
110694
|
};
|
|
110695
|
+
delete headers.Authorization;
|
|
110695
110696
|
const apiKey = process.env.OPENAI_API_KEY ?? "";
|
|
110696
110697
|
const isAzure = /cognitiveservices\.azure\.com|openai\.azure\.com/.test(request.baseUrl);
|
|
110697
|
-
|
|
110698
|
+
const isOpenRouter = isEnvTruthy(process.env.CLAUDE_CODE_USE_OPENROUTER);
|
|
110699
|
+
if (isOpenRouter) {
|
|
110700
|
+
const orKey = process.env.OPENROUTER_API_KEY ?? "";
|
|
110701
|
+
if (orKey) {
|
|
110702
|
+
headers.Authorization = `Bearer ${orKey}`;
|
|
110703
|
+
}
|
|
110704
|
+
headers["HTTP-Referer"] = process.env.OPENROUTER_REFERER ?? "https://github.com/PiceOfPentogramm/alterclaude";
|
|
110705
|
+
headers["X-Title"] = process.env.OPENROUTER_TITLE ?? "AlterClaude";
|
|
110706
|
+
}
|
|
110707
|
+
if (!isOpenRouter && apiKey) {
|
|
110698
110708
|
if (isAzure) {
|
|
110699
110709
|
headers["api-key"] = apiKey;
|
|
110700
110710
|
} else {
|
|
@@ -110705,10 +110715,22 @@ class OpenAIShimMessages {
|
|
|
110705
110715
|
headers.Accept = "application/vnd.github.v3+json";
|
|
110706
110716
|
headers["X-GitHub-Api-Version"] = GITHUB_API_VERSION;
|
|
110707
110717
|
}
|
|
110708
|
-
|
|
110709
|
-
|
|
110710
|
-
|
|
110711
|
-
|
|
110718
|
+
if (isOpenRouter && process.env.ALTERCLAUDE_DEBUG) {
|
|
110719
|
+
process.stderr.write(`
|
|
110720
|
+
[ALTERCLAUDE_DEBUG] OR key set: ${!!headers.Authorization}
|
|
110721
|
+
`);
|
|
110722
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] Auth header length: ${(headers.Authorization || "").length}
|
|
110723
|
+
`);
|
|
110724
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] Auth starts with: ${(headers.Authorization || "").slice(0, 15)}
|
|
110725
|
+
`);
|
|
110726
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] OPENROUTER_API_KEY env: ${!!process.env.OPENROUTER_API_KEY}
|
|
110727
|
+
`);
|
|
110728
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] OPENAI_API_KEY env: ${!!process.env.OPENAI_API_KEY}
|
|
110729
|
+
`);
|
|
110730
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] CLAUDE_CODE_USE_OPENROUTER: ${process.env.CLAUDE_CODE_USE_OPENROUTER}
|
|
110731
|
+
`);
|
|
110732
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] ANTHROPIC_AUTH_TOKEN env: ${!!process.env.ANTHROPIC_AUTH_TOKEN}
|
|
110733
|
+
`);
|
|
110712
110734
|
}
|
|
110713
110735
|
let chatCompletionsUrl;
|
|
110714
110736
|
if (isAzure) {
|
|
@@ -110724,6 +110746,25 @@ class OpenAIShimMessages {
|
|
|
110724
110746
|
} else {
|
|
110725
110747
|
chatCompletionsUrl = `${request.baseUrl}/chat/completions`;
|
|
110726
110748
|
}
|
|
110749
|
+
if (isOpenRouter && process.env.ALTERCLAUDE_DEBUG) {
|
|
110750
|
+
process.stderr.write(`
|
|
110751
|
+
[ALTERCLAUDE_DEBUG] OR key set: ${!!headers.Authorization}
|
|
110752
|
+
`);
|
|
110753
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] Auth header length: ${(headers.Authorization || "").length}
|
|
110754
|
+
`);
|
|
110755
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] Auth starts with: ${(headers.Authorization || "").slice(0, 15)}
|
|
110756
|
+
`);
|
|
110757
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] OPENROUTER_API_KEY env: ${!!process.env.OPENROUTER_API_KEY}
|
|
110758
|
+
`);
|
|
110759
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] OPENAI_API_KEY env: ${!!process.env.OPENAI_API_KEY}
|
|
110760
|
+
`);
|
|
110761
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] CLAUDE_CODE_USE_OPENROUTER: ${process.env.CLAUDE_CODE_USE_OPENROUTER}
|
|
110762
|
+
`);
|
|
110763
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] ANTHROPIC_AUTH_TOKEN env: ${!!process.env.ANTHROPIC_AUTH_TOKEN}
|
|
110764
|
+
`);
|
|
110765
|
+
process.stderr.write(`[ALTERCLAUDE_DEBUG] Chat URL: ${chatCompletionsUrl}
|
|
110766
|
+
`);
|
|
110767
|
+
}
|
|
110727
110768
|
const fetchInit = {
|
|
110728
110769
|
method: "POST",
|
|
110729
110770
|
headers,
|
|
@@ -120164,7 +120205,7 @@ function printStartupScreen() {
|
|
|
120164
120205
|
const sLen = ` ● ${sL} Ready — type /help to begin`.length;
|
|
120165
120206
|
out.push(boxRow(sRow, W2, sLen));
|
|
120166
120207
|
out.push(`${rgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET}`);
|
|
120167
|
-
out.push(` ${DIM}${rgb(...DIMCOL)}alterclaude ${RESET}${rgb(...ACCENT)}v${"0.1.
|
|
120208
|
+
out.push(` ${DIM}${rgb(...DIMCOL)}alterclaude ${RESET}${rgb(...ACCENT)}v${"0.1.5"}${RESET}`);
|
|
120168
120209
|
out.push("");
|
|
120169
120210
|
process.stdout.write(out.join(`
|
|
120170
120211
|
`) + `
|
|
@@ -358918,7 +358959,7 @@ function getAnthropicEnvMetadata() {
|
|
|
358918
358959
|
function getBuildAgeMinutes() {
|
|
358919
358960
|
if (false)
|
|
358920
358961
|
;
|
|
358921
|
-
const buildTime = new Date("2026-05-
|
|
358962
|
+
const buildTime = new Date("2026-05-29T16:09:32.962Z").getTime();
|
|
358922
358963
|
if (isNaN(buildTime))
|
|
358923
358964
|
return;
|
|
358924
358965
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -451510,7 +451551,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
451510
451551
|
var call58 = async () => {
|
|
451511
451552
|
return {
|
|
451512
451553
|
type: "text",
|
|
451513
|
-
value: `${"99.0.0"} (built ${"2026-05-
|
|
451554
|
+
value: `${"99.0.0"} (built ${"2026-05-29T16:09:32.962Z"})`
|
|
451514
451555
|
};
|
|
451515
451556
|
}, version2, version_default;
|
|
451516
451557
|
var init_version = __esm(() => {
|
|
@@ -524651,7 +524692,7 @@ function WelcomeV2() {
|
|
|
524651
524692
|
dimColor: true,
|
|
524652
524693
|
children: [
|
|
524653
524694
|
"v",
|
|
524654
|
-
"0.1.
|
|
524695
|
+
"0.1.5",
|
|
524655
524696
|
" "
|
|
524656
524697
|
]
|
|
524657
524698
|
}, undefined, true, undefined, this)
|
|
@@ -524851,7 +524892,7 @@ function WelcomeV2() {
|
|
|
524851
524892
|
dimColor: true,
|
|
524852
524893
|
children: [
|
|
524853
524894
|
"v",
|
|
524854
|
-
"0.1.
|
|
524895
|
+
"0.1.5",
|
|
524855
524896
|
" "
|
|
524856
524897
|
]
|
|
524857
524898
|
}, undefined, true, undefined, this)
|
|
@@ -525077,7 +525118,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
525077
525118
|
dimColor: true,
|
|
525078
525119
|
children: [
|
|
525079
525120
|
"v",
|
|
525080
|
-
"0.1.
|
|
525121
|
+
"0.1.5",
|
|
525081
525122
|
" "
|
|
525082
525123
|
]
|
|
525083
525124
|
}, undefined, true, undefined, this);
|
|
@@ -525331,7 +525372,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
525331
525372
|
dimColor: true,
|
|
525332
525373
|
children: [
|
|
525333
525374
|
"v",
|
|
525334
|
-
"0.1.
|
|
525375
|
+
"0.1.5",
|
|
525335
525376
|
" "
|
|
525336
525377
|
]
|
|
525337
525378
|
}, undefined, true, undefined, this);
|
|
@@ -545879,7 +545920,7 @@ Usage: claude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
545879
545920
|
pendingHookMessages
|
|
545880
545921
|
}, renderAndRun);
|
|
545881
545922
|
}
|
|
545882
|
-
}).version("0.1.
|
|
545923
|
+
}).version("0.1.5 (Alter Claude)", "-v, --version", "Output the version number");
|
|
545883
545924
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
545884
545925
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
545885
545926
|
if (canUserConfigureAdvisor()) {
|
|
@@ -546459,7 +546500,7 @@ function validateProviderEnvOrExit() {
|
|
|
546459
546500
|
async function main2() {
|
|
546460
546501
|
const args = process.argv.slice(2);
|
|
546461
546502
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
546462
|
-
console.log(`${"0.1.
|
|
546503
|
+
console.log(`${"0.1.5"} (Alter Claude)`);
|
|
546463
546504
|
return;
|
|
546464
546505
|
}
|
|
546465
546506
|
{
|
|
@@ -546571,4 +546612,4 @@ async function main2() {
|
|
|
546571
546612
|
}
|
|
546572
546613
|
main2();
|
|
546573
546614
|
|
|
546574
|
-
//# debugId=
|
|
546615
|
+
//# debugId=B46B148532D1933964756E2164756E21
|