codex-mobile-re 0.1.94 → 0.1.96
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/assets/{AutomationsPanel-DW9AQQmm.js → AutomationsPanel-D1RUtAUf.js} +1 -1
- package/dist/assets/{DirectoryHub-2dtGwRd2.js → DirectoryHub-DRCFOJD-.js} +1 -1
- package/dist/assets/{ReviewPane-RX-5_hZE.js → ReviewPane-BFlIAuK6.js} +1 -1
- package/dist/assets/{ThreadConversation-TqhCSIwa.js → ThreadConversation-Bw0IxwdA.js} +1 -1
- package/dist/assets/{ThreadTerminalPanel-BdfkWAD-.js → ThreadTerminalPanel-CWk5_mkT.js} +1 -1
- package/dist/assets/index-BCEfBt5u.js +86 -0
- package/dist/assets/{index-0DXJVzPV.css → index-CJxQMdGE.css} +1 -1
- package/dist/index.html +2 -2
- package/dist-cli/index.js +61 -20
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/index-DzPfsKYl.js +0 -85
package/dist/index.html
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
<link rel="icon" type="image/png" sizes="192x192" href="/icons/pwa-192x192.png" />
|
|
13
13
|
<link rel="apple-touch-icon" sizes="180x180" href="/icons/apple-touch-icon.png" />
|
|
14
14
|
<title>Codex Web</title>
|
|
15
|
-
<script type="module" crossorigin src="/assets/index-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
15
|
+
<script type="module" crossorigin src="/assets/index-BCEfBt5u.js"></script>
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CJxQMdGE.css">
|
|
17
17
|
</head>
|
|
18
18
|
<body class="bg-slate-950">
|
|
19
19
|
<div id="app"></div>
|
package/dist-cli/index.js
CHANGED
|
@@ -5041,7 +5041,8 @@ var ExternalSessionTracker = class {
|
|
|
5041
5041
|
if (threadSource) {
|
|
5042
5042
|
session.threadSource = threadSource;
|
|
5043
5043
|
}
|
|
5044
|
-
const
|
|
5044
|
+
const isSubagent = threadSource.toLowerCase().startsWith("subagent");
|
|
5045
|
+
const sessionId = isSubagent ? readNonEmptyString(payload.id) || readNonEmptyString(payload.session_id) : readNonEmptyString(payload.session_id) || readNonEmptyString(payload.id);
|
|
5045
5046
|
if (sessionId) {
|
|
5046
5047
|
session.sessionId = sessionId;
|
|
5047
5048
|
}
|
|
@@ -8626,6 +8627,34 @@ async function fetchCustomEndpointDefaultModel(baseUrl, apiKey) {
|
|
|
8626
8627
|
return "";
|
|
8627
8628
|
}
|
|
8628
8629
|
}
|
|
8630
|
+
var CUSTOM_ENDPOINT_PATH_SUFFIXES = ["/chat/completions", "/responses"];
|
|
8631
|
+
function normalizeCustomEndpointBaseUrl(input) {
|
|
8632
|
+
let url = input.trim();
|
|
8633
|
+
if (!url) return "";
|
|
8634
|
+
url = url.replace(/\/+$/u, "");
|
|
8635
|
+
const lowered = url.toLowerCase();
|
|
8636
|
+
for (const suffix of CUSTOM_ENDPOINT_PATH_SUFFIXES) {
|
|
8637
|
+
if (lowered.endsWith(suffix)) {
|
|
8638
|
+
url = url.slice(0, url.length - suffix.length);
|
|
8639
|
+
break;
|
|
8640
|
+
}
|
|
8641
|
+
}
|
|
8642
|
+
return url.replace(/\/+$/u, "");
|
|
8643
|
+
}
|
|
8644
|
+
async function fetchCustomEndpointModelIds(customBaseUrl, apiKey) {
|
|
8645
|
+
try {
|
|
8646
|
+
const modelsUrl = customBaseUrl.replace(/\/+$/, "") + "/models";
|
|
8647
|
+
const headers = {};
|
|
8648
|
+
if (apiKey && apiKey !== "dummy") {
|
|
8649
|
+
headers["Authorization"] = `Bearer ${apiKey}`;
|
|
8650
|
+
}
|
|
8651
|
+
const resp = await fetch(modelsUrl, { headers, signal: AbortSignal.timeout(8e3) });
|
|
8652
|
+
if (!resp.ok) return [];
|
|
8653
|
+
return normalizeProviderModelsData(await resp.json());
|
|
8654
|
+
} catch {
|
|
8655
|
+
return [];
|
|
8656
|
+
}
|
|
8657
|
+
}
|
|
8629
8658
|
async function fetchOpenCodeZenModelIds(apiKey) {
|
|
8630
8659
|
const headers = {};
|
|
8631
8660
|
if (apiKey && apiKey !== "dummy") {
|
|
@@ -13356,7 +13385,8 @@ function createCodexBridgeMiddleware() {
|
|
|
13356
13385
|
if (req.method === "POST" && url.pathname === "/codex-api/free-mode/custom-provider") {
|
|
13357
13386
|
try {
|
|
13358
13387
|
const body = await readJsonBody2(req);
|
|
13359
|
-
const
|
|
13388
|
+
const rawBaseUrl = typeof body?.baseUrl === "string" ? body.baseUrl.trim() : "";
|
|
13389
|
+
const baseUrl = normalizeCustomEndpointBaseUrl(rawBaseUrl);
|
|
13360
13390
|
const apiKey = typeof body?.apiKey === "string" ? body.apiKey.trim() : "";
|
|
13361
13391
|
const wireApi = body?.wireApi === "chat" ? "chat" : "responses";
|
|
13362
13392
|
const providerType = body?.provider === "opencode-zen" ? "opencode-zen" : body?.provider === "openrouter" ? "openrouter" : "custom";
|
|
@@ -13944,6 +13974,31 @@ function createCodexBridgeMiddleware() {
|
|
|
13944
13974
|
try {
|
|
13945
13975
|
const requestedProvider = url.searchParams.get("provider")?.trim() ?? "";
|
|
13946
13976
|
if (requestedProvider) {
|
|
13977
|
+
const normalizedRequestedProvider = requestedProvider.replace(/_/g, "-");
|
|
13978
|
+
const fmState2 = ensureDefaultFreeModeStateForMissingAuthSync(join9(getCodexHomeDir5(), FREE_MODE_STATE_FILE));
|
|
13979
|
+
if (fmState2?.enabled && normalizedRequestedProvider === CUSTOM_RUNTIME_PROVIDER_ID.replace(/_/g, "-") && fmState2.provider === "custom" && fmState2.customBaseUrl) {
|
|
13980
|
+
setJson4(res, 200, {
|
|
13981
|
+
data: await fetchCustomEndpointModelIds(fmState2.customBaseUrl, fmState2.apiKey ?? ""),
|
|
13982
|
+
exclusive: true,
|
|
13983
|
+
source: "custom"
|
|
13984
|
+
});
|
|
13985
|
+
return;
|
|
13986
|
+
}
|
|
13987
|
+
if (fmState2?.enabled && normalizedRequestedProvider === OPENCODE_ZEN_RUNTIME_PROVIDER_ID.replace(/_/g, "-") && fmState2.provider === "opencode-zen") {
|
|
13988
|
+
setJson4(res, 200, {
|
|
13989
|
+
data: filterOpenCodeZenModelsForAuthState(
|
|
13990
|
+
sortOpenCodeZenModelIds(await fetchOpenCodeZenModelIds(fmState2.apiKey)),
|
|
13991
|
+
fmState2.apiKey
|
|
13992
|
+
),
|
|
13993
|
+
exclusive: true,
|
|
13994
|
+
source: "opencode-zen"
|
|
13995
|
+
});
|
|
13996
|
+
return;
|
|
13997
|
+
}
|
|
13998
|
+
if (fmState2?.enabled && normalizedRequestedProvider === FREE_MODE_RUNTIME_PROVIDER_ID.replace(/_/g, "-") && fmState2.provider === "openrouter") {
|
|
13999
|
+
setJson4(res, 200, { data: await getFreeModels(), exclusive: true, source: "openrouter" });
|
|
14000
|
+
return;
|
|
14001
|
+
}
|
|
13947
14002
|
setJson4(res, 200, {
|
|
13948
14003
|
...await readProviderModelIdsForProvider(appServer, requestedProvider),
|
|
13949
14004
|
exclusive: true
|
|
@@ -13968,24 +14023,10 @@ function createCodexBridgeMiddleware() {
|
|
|
13968
14023
|
return;
|
|
13969
14024
|
}
|
|
13970
14025
|
if (fmState.provider === "custom" && fmState.customBaseUrl) {
|
|
13971
|
-
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
|
|
13975
|
-
headers["Authorization"] = `Bearer ${fmState.apiKey}`;
|
|
13976
|
-
}
|
|
13977
|
-
const resp = await fetch(modelsUrl, { headers, signal: AbortSignal.timeout(8e3) });
|
|
13978
|
-
if (resp.ok) {
|
|
13979
|
-
const json = await resp.json();
|
|
13980
|
-
const ids = normalizeProviderModelsData(json);
|
|
13981
|
-
const currentModel = fmState.model?.trim() ?? "";
|
|
13982
|
-
const orderedIds = currentModel && ids.includes(currentModel) ? [currentModel, ...ids.filter((id) => id !== currentModel)] : ids;
|
|
13983
|
-
setJson4(res, 200, { data: orderedIds, exclusive: true, source: "custom" });
|
|
13984
|
-
return;
|
|
13985
|
-
}
|
|
13986
|
-
} catch {
|
|
13987
|
-
}
|
|
13988
|
-
setJson4(res, 200, { data: [], exclusive: true, source: "custom" });
|
|
14026
|
+
const ids = await fetchCustomEndpointModelIds(fmState.customBaseUrl, fmState.apiKey ?? "");
|
|
14027
|
+
const currentModel = fmState.model?.trim() ?? "";
|
|
14028
|
+
const orderedIds = currentModel && ids.includes(currentModel) ? [currentModel, ...ids.filter((id) => id !== currentModel)] : ids;
|
|
14029
|
+
setJson4(res, 200, { data: orderedIds, exclusive: true, source: "custom" });
|
|
13989
14030
|
return;
|
|
13990
14031
|
}
|
|
13991
14032
|
const freeModels = await getFreeModels();
|