@bman654/clodex 2.16.0 → 2.17.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/README.md +5 -5
- package/dist/cli.js +20 -18
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,8 +22,8 @@ Contributions are welcome — see [CONTRIBUTING.md](./CONTRIBUTING.md) for how t
|
|
|
22
22
|
npm install -g @bman654/clodex # 1. install the CLI (Node 22+)
|
|
23
23
|
clodex providers auth openai # 2. sign in with your ChatGPT/Codex plan (device-code OAuth)
|
|
24
24
|
clodex models # 3. pick favorite models and aliases
|
|
25
|
-
clodex models --alias sol=clodex:openai-oauth:gpt-
|
|
26
|
-
clodex models --alias luna=clodex:openai-oauth:gpt-
|
|
25
|
+
clodex models --alias sol=clodex:openai-oauth:gpt-6-sol
|
|
26
|
+
clodex models --alias luna=clodex:openai-oauth:gpt-6-luna
|
|
27
27
|
clodex models --alias terra=clodex:openai-oauth:gpt-5.6-terra
|
|
28
28
|
clodex patch # 4. (optional) patch Claude Code so those models are first-class
|
|
29
29
|
clodex claude # 5. launch Claude Code on an OpenAI model
|
|
@@ -80,7 +80,7 @@ Clodex avoids this. In proxy mode it uses an HTTP proxy to intercept requests bo
|
|
|
80
80
|
|
|
81
81
|
Both `clodex claude` and `clodex server` support two bridge modes. A mode flag applies to **that run only**; to change a command's default, add `--save-mode` (e.g. `clodex claude --endpoint --save-mode`). With no flag and nothing saved, both commands default to **proxy** mode, which works with your existing Claude auth.
|
|
82
82
|
|
|
83
|
-
- **`--proxy`** (the default): a selective man-in-the-middle proxy for `api.anthropic.com`. Claude Code keeps its normal Anthropic login — Anthropic models work untouched — while models named `clodex:<provider-id>:<model-id>` (or their saved aliases) route to the selected configured provider. Switch with `/model clodex:openai-oauth:gpt-
|
|
83
|
+
- **`--proxy`** (the default): a selective man-in-the-middle proxy for `api.anthropic.com`. Claude Code keeps its normal Anthropic login — Anthropic models work untouched — while models named `clodex:<provider-id>:<model-id>` (or their saved aliases) route to the selected configured provider. Switch with `/model clodex:openai-oauth:gpt-6-sol` or `/model sol` after patching.
|
|
84
84
|
- **`--endpoint`**: clodex runs a local Anthropic-format gateway and launches Claude Code with `ANTHROPIC_BASE_URL` pointed at it. All traffic goes through the gateway. With favorites saved, the gateway is multi-route and Claude Code's `/model` menu lists your starting model plus favorites for live switching.
|
|
85
85
|
|
|
86
86
|
> [!TIP]
|
|
@@ -238,7 +238,7 @@ Manage favorite models (max 20) and short aliases. Favorites feed the endpoint-m
|
|
|
238
238
|
| --- | --- |
|
|
239
239
|
| *(none)* | Interactive manager: search all providers or browse one at a time |
|
|
240
240
|
| `--list` | Print the exact `clodex:<provider-id>:<model-id>` names (and aliases) without opening the manager |
|
|
241
|
-
| `--alias <name=target>` | Save a short name for a favorite, e.g. `--alias sol=clodex:openai-oauth:gpt-
|
|
241
|
+
| `--alias <name=target>` | Save a short name for a favorite, e.g. `--alias sol=clodex:openai-oauth:gpt-6-sol` (the `clodex:` prefix is optional in the target) |
|
|
242
242
|
| `--unalias <name>` | Remove a saved short name |
|
|
243
243
|
| `--context <model=stop>` | Choose how much of a model's context window to use: `standard`, `max`, `default` to clear, or a token count such as `500k`. Applies to this run unless `--save` is given |
|
|
244
244
|
| `--save` | With `--context`: store the stop as that model's default |
|
|
@@ -367,7 +367,7 @@ clodex --version # version
|
|
|
367
367
|
this pre-dispatch intent, not proof of wire serialization. If the provider
|
|
368
368
|
SDK reports that it omitted the tier for a model, clodex warns once and the
|
|
369
369
|
backend default remains in use.
|
|
370
|
-
- **Outbound proxy:** when `HTTP_PROXY`/`HTTPS_PROXY` (and optionally `NO_PROXY`) are set in clodex's environment, all clodex-originated network calls honor them — OAuth sign-in and token refresh, model-list and models.dev refreshes, upstream OpenAI API calls, and the ChatGPT/Codex OAuth WebSocket transport (tunneled via HTTP CONNECT).
|
|
370
|
+
- **Outbound proxy:** when `HTTP_PROXY`/`HTTPS_PROXY` (and optionally `NO_PROXY`) are set in clodex's environment, all clodex-originated network calls honor them — OAuth sign-in and token refresh, model-list and models.dev refreshes, upstream OpenAI API calls, and the ChatGPT/Codex OAuth WebSocket transport (tunneled via HTTP CONNECT). In proxy mode this also covers the web traffic Claude Code itself makes through the clodex proxy, so web fetches and searches work behind a corporate proxy instead of failing on a blocked direct connection.
|
|
371
371
|
- **Provider timeouts:** `CLODEX_UPSTREAM_IDLE_TIMEOUT_MS` controls how long an
|
|
372
372
|
SDK-backed translated stream may produce no event (default `120000`; range
|
|
373
373
|
`10000`–`3600000` ms). `CLODEX_UPSTREAM_TOTAL_TIMEOUT_MS` limits each call
|
package/dist/cli.js
CHANGED
|
@@ -346,7 +346,7 @@ import { join } from "path";
|
|
|
346
346
|
// package.json
|
|
347
347
|
var package_default = {
|
|
348
348
|
name: "@bman654/clodex",
|
|
349
|
-
version: "2.
|
|
349
|
+
version: "2.17.0",
|
|
350
350
|
publishConfig: {
|
|
351
351
|
access: "public"
|
|
352
352
|
},
|
|
@@ -434,7 +434,7 @@ var package_default = {
|
|
|
434
434
|
|
|
435
435
|
// src/constants.ts
|
|
436
436
|
var CODEX_RESPONSES_LITE_WS_URL = "wss://chatgpt.com/backend-api/codex/responses";
|
|
437
|
-
var CODEX_RESPONSES_LITE_VERSION = "0.
|
|
437
|
+
var CODEX_RESPONSES_LITE_VERSION = "0.156.0";
|
|
438
438
|
var CODEX_RESPONSES_WEBSOCKETS_BETA = "responses_websockets=2026-02-06";
|
|
439
439
|
var TEST_TIMEOUT_MS = 1e4;
|
|
440
440
|
var CONFLICTING_ENV_VARS = [
|
|
@@ -631,6 +631,7 @@ var HEURISTIC_RULES = [
|
|
|
631
631
|
[/claude/i, 2e5],
|
|
632
632
|
[/deepseek-v4|deepseek-r1|deepseek-reasoner/i, 1e6],
|
|
633
633
|
[/deepseek/i, 64e3],
|
|
634
|
+
[/gpt-6-(?:astra|sol|luna)/i, 105e4],
|
|
634
635
|
[/gpt-5|gpt-4\.1|o3-|o4-/i, 1e6],
|
|
635
636
|
[/gpt-4o|gpt-4-turbo|gpt-4/i, 128e3],
|
|
636
637
|
[/gpt-oss/i, 131072],
|
|
@@ -5979,21 +5980,22 @@ function deriveBrand(family) {
|
|
|
5979
5980
|
}
|
|
5980
5981
|
|
|
5981
5982
|
// src/data/openai-oauth-models.ts
|
|
5982
|
-
var
|
|
5983
|
-
var
|
|
5983
|
+
var GPT_HIGH_CONTEXT_PRICING_BOUNDARY = 272e3;
|
|
5984
|
+
var GPT_HIGH_CONTEXT_PRICING_NOTE = "Above it, OpenAI prices the full request at 2x input and 1.5x output.";
|
|
5984
5985
|
var CHATGPT_CODEX_UNSUPPORTED_MODELS = /* @__PURE__ */ new Set([
|
|
5985
5986
|
"gpt-5.5-fast"
|
|
5986
5987
|
// confirmed: rejected by chatgpt.com/backend-api/codex
|
|
5987
5988
|
]);
|
|
5988
5989
|
var OPENAI_OAUTH_MODEL_SEEDS = [
|
|
5989
|
-
// GPT-6 family. The window and
|
|
5990
|
-
// 2026-09-04 and
|
|
5991
|
-
//
|
|
5992
|
-
//
|
|
5993
|
-
//
|
|
5994
|
-
//
|
|
5995
|
-
// and 1.5x output for the full request" — the same boundary the GPT-5.6 family has.
|
|
5990
|
+
// GPT-6 family. The window, ceiling and Responses-Lite flags are what the live
|
|
5991
|
+
// Codex catalog returned (Astra on 2026-09-04, Sol and Luna on 2026-09-22) and are
|
|
5992
|
+
// deliberately NOT the published API numbers: the model cards list a 1,050,000
|
|
5993
|
+
// context window, but the Codex client is served a smaller one, and this path is
|
|
5994
|
+
// Codex-only. All three cards publish a 128,000 output limit and the same 272K
|
|
5995
|
+
// pricing boundary as the GPT-5.6 family.
|
|
5996
5996
|
{ id: "gpt-6-astra", name: "GPT-6 Astra", contextWindow: 272e3, maxContextWindow: 872e3, maxOutputTokens: 128e3, reasoning: true, useResponsesLite: true, preferWebSockets: true },
|
|
5997
|
+
{ id: "gpt-6-sol", name: "GPT-6 Sol", contextWindow: 272e3, maxContextWindow: 872e3, maxOutputTokens: 128e3, reasoning: true, useResponsesLite: true, preferWebSockets: true },
|
|
5998
|
+
{ id: "gpt-6-luna", name: "GPT-6 Luna", contextWindow: 272e3, maxContextWindow: 872e3, maxOutputTokens: 128e3, reasoning: true, useResponsesLite: true, preferWebSockets: true },
|
|
5997
5999
|
// "An alias for our flagship general-purpose models, with safeguards calibrated
|
|
5998
6000
|
// for defensive cybersecurity work" — access is gated on a separate opt-in
|
|
5999
6001
|
// program, so most installs will never see this id in their catalog.
|
|
@@ -6028,8 +6030,8 @@ function hasPricingBoundary(id) {
|
|
|
6028
6030
|
function openAiPricingMetadata(id) {
|
|
6029
6031
|
if (!hasPricingBoundary(id)) return {};
|
|
6030
6032
|
return {
|
|
6031
|
-
pricingBoundary:
|
|
6032
|
-
pricingBoundaryNote:
|
|
6033
|
+
pricingBoundary: GPT_HIGH_CONTEXT_PRICING_BOUNDARY,
|
|
6034
|
+
pricingBoundaryNote: GPT_HIGH_CONTEXT_PRICING_NOTE
|
|
6033
6035
|
};
|
|
6034
6036
|
}
|
|
6035
6037
|
var LEGACY_IMPOSED_CONTEXT_PERCENT = 95;
|
|
@@ -11080,7 +11082,7 @@ function supportsExtendedCodexEffort(modelId) {
|
|
|
11080
11082
|
return /^gpt-daybreak(?:-|$)/i.test(modelId);
|
|
11081
11083
|
}
|
|
11082
11084
|
function supportsNoneEffort(modelId) {
|
|
11083
|
-
return /^gpt-5\.6(?:-|$)/i.test(modelId) || /^gpt-daybreak-blue(?:-|$)/i.test(modelId);
|
|
11085
|
+
return /^gpt-5\.6(?:-|$)/i.test(modelId) || /^gpt-6-(?:sol|luna)(?:-|$)/i.test(modelId) || /^gpt-daybreak-blue(?:-|$)/i.test(modelId);
|
|
11084
11086
|
}
|
|
11085
11087
|
function isReasoningSummaryUnsupportedModel(modelId) {
|
|
11086
11088
|
return /codex-spark(?:-|$)/i.test(modelId);
|
|
@@ -22092,7 +22094,7 @@ ${pc13.bold("Examples:")}
|
|
|
22092
22094
|
clodex claude --trace --resume abc-123
|
|
22093
22095
|
clodex claude --endpoint
|
|
22094
22096
|
clodex claude --endpoint --save-mode
|
|
22095
|
-
clodex claude --provider openai-oauth --model gpt-
|
|
22097
|
+
clodex claude --provider openai-oauth --model gpt-6-sol
|
|
22096
22098
|
clodex claude -- --print "hello"
|
|
22097
22099
|
clodex claude -- --dangerously-skip-permissions`;
|
|
22098
22100
|
}
|
|
@@ -22180,7 +22182,7 @@ Manage favorite models for mid-session switching.
|
|
|
22180
22182
|
${pc13.bold("Usage:")}
|
|
22181
22183
|
clodex favorites
|
|
22182
22184
|
clodex models --list
|
|
22183
|
-
clodex models --alias sol=clodex:openai-oauth:gpt-
|
|
22185
|
+
clodex models --alias sol=clodex:openai-oauth:gpt-6-sol
|
|
22184
22186
|
clodex models --unalias sol
|
|
22185
22187
|
clodex models --context sol=max --save
|
|
22186
22188
|
clodex models --json
|
|
@@ -22213,13 +22215,13 @@ ${pc13.bold("How it works:")}
|
|
|
22213
22215
|
Claude Code binary so they pass model validation and report real context.
|
|
22214
22216
|
|
|
22215
22217
|
${pc13.bold("Context stops and cost:")}
|
|
22216
|
-
Some providers price large prompts in bands: GPT-5.6
|
|
22218
|
+
Some providers price large prompts in bands: GPT-5.6 and GPT-6 bill the full request at
|
|
22217
22219
|
a higher rate above 272,000 input tokens. The standard stop stays under that
|
|
22218
22220
|
line, so max is opt-in and reports the boundary when you select it.
|
|
22219
22221
|
|
|
22220
22222
|
${pc13.bold("Examples:")}
|
|
22221
22223
|
clodex favorites
|
|
22222
|
-
clodex models --alias sol=clodex:openai-oauth:gpt-
|
|
22224
|
+
clodex models --alias sol=clodex:openai-oauth:gpt-6-sol
|
|
22223
22225
|
clodex models --context sol=max --save
|
|
22224
22226
|
clodex claude # switch menu active when favorites are set`;
|
|
22225
22227
|
}
|